Skip to content

Instantly share code, notes, and snippets.

@bdunnette
Last active December 16, 2022 22:09
Show Gist options
  • Save bdunnette/940de2c5df26aa1d33ba9673c063f826 to your computer and use it in GitHub Desktop.
Save bdunnette/940de2c5df26aa1d33ba9673c063f826 to your computer and use it in GitHub Desktop.
Deleting a Funkwhale library via manage.py

Enter the virtualenv and run Django shell:

cd /srv/funkwhale/
source virtualenv/bin/activate
./manage shell

Import Funkwhale models:

In [1]: import funkwhale_api.music as music

Select library to remove (get primary key from e.g. Django admin):

In [2]: bad_library = music.models.Library.objects.get(pk=41)

Verify that it's the library you're looking for:

In [3]: bad_library
Out[3]: <Library: Free Music Archive>

Delete library (and related objects):

In [4]: bad_library.delete()

Exit the CLI:

In [5]: exit()

Prune library to get rid of "dangling" tracks:

./manage prune_library --albums --artists --tracks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment