Jump to content

Bug; Server; 3.2.27; Collections are not deleted when deleting a library


Recommended Posts

Sludge Vohaul
Posted

Hi,

 

I think there is an issue with collections in an movie type library.

 

When a movie library containing collections (no matter whether empty or not) is

deleted and re-created (same type, same path), then the existing collections

preserve the library deletion (i.e. they still exist in the re-created

library).

 

This is reproducible with server version 3.2.27

 

Can anyone confirm this?

Posted

Collections are separate, just like playlists, so they need to be deleted separately.

Sludge Vohaul
Posted

Oh, didn't know that.

 

So, if a user's intension is to remove a library and everything that belongs to this library, (s)he has to delete the collections in question _ahead_, because after deletion of the library the collections are not shown anymore (i.e. cannot be deleted).

 

As in my case the deleted library was the only one existing, and after it's deletion the Emby server had no content at all, this means that the DB's referential integrity gets corrupted somewhere. There's probably a "collection-item"-table in the DB referencing "items"- and "collections"-table by some reproducible foreign key (an item's filepath, imdbid,...).

 

IMO this is a potential cause for headaches and should be fixed in the long run as it is cluttering the DB.

Posted

Yea there is probably a case to be made to clean them up. On the other hand, if you're reorganizing your library folders and you remove a library with the intention of adding it back, you might not be expecting your collections or playlists to get wiped out.

Sludge Vohaul
Posted

Hm, interesting point of view. Might indeed be user friendly.

 

It's a sort of a VLC (or whatever) playlist thinking. The playlist exists, and even if I delete the files on the file system, it still exists. I only cannot play the songs it contains. But if I put the files back from the trash bin, everything will be fine again.

But I am also free to delete the playlist (hey, what do I need a playlist for, for file I don't have anymore?).

 

In Emby exactly this is not possible - I either delete the playlist ahead, or I delete the files, and then the playlist is still there lurking to jump on me as soon as I add a matching file years later - there's no way to delete the playlist once the files are gone.

So maybe there should be a "orphaned collections/playlists/..." do-something-with-it-functionality somewhere...

Happy2Play
Posted

Or go to where playlist and collections are stored and delete them.

 

\Emby-Server\data

Posted

Or go to where playlist and collections are stored and delete them.

 

\Emby-Server\data

 

average user will never think of that though.

Sludge Vohaul
Posted (edited)

@@Happy2Play

 

How exactly am I supposed to find _orphaned_ objects on the file system?

Edited by Sludge Vohaul
Happy2Play
Posted

@@Happy2Play

 

How exactly am I supposed to find _orphaned_ objects on the file system?

 

Honestly only you know what you delete and if you still see them then you know where to look.  Edit info should tell you a location also.

 

If it is orphaned in the database then it is a different story, as most of the time when that happens you have to rebuild the database.

Sludge Vohaul
Posted

@@Happy2Play

 

I've seen the term "rebuilding the database" in a few threads, but never bothered what it is.

Now I've tried to look it up, but am still unsure what it is. Do you you mean by that deleting a library in the WebUI->Settings->Library->"a library's popup menu"->Remove, or deleting some SQLite files in the server's data directory on the FS?

Happy2Play
Posted

@@Happy2Play

 

I've seen the term "rebuilding the database" in a few threads, but never bothered what it is.

Now I've tried to look it up, but am still unsure what it is. Do you you mean by that deleting a library in the WebUI->Settings->Library->"a library's popup menu"->Remove, or deleting some SQLite files in the server's data directory on the FS?

 

That would deleting be the library.db and allowing it to rebuild.

 

But if this is done you have to remember your watched status/userdata Is stored in that same data now.  So you need to user the Server Configuration Backup plugin or ensure you maintain a copy of that database to export the userdata table to new database.

 

But in the case of this issue I would just delete the items in your \Emby-Server\data\collections folder and allow them to regenerate as long as they custom collections and you use Auto-Boxset.

Sludge Vohaul
Posted

Thanks for the info.

 

I don't have any issues with it, I just noticed that the old collections appeared when I deleted and recreated a library on my development installation.

 

None the less I'd still opt for a "delete orphaned objects"-button somewhere in the UI :)

Posted

At the time you delete the library it is probably a nice idea to include a checkbox to decide whether you want to do that or not.

  • Like 1
Sludge Vohaul
Posted

@@Luke

 

Like this idea. For the sake of completeness the checkbox should also be available when deleting an item, not only the library.

And to get the bonus the delete "popups" should have a checkboxlist with all collections/playlists/... which will become orphaned after deleting this item :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...