MediaBrowser / Emby.AutoOrganize

Auto-organize plugin for Emby Server
MIT License
21 stars 18 forks source link

Rel 1.2.4 #10

Closed PoppyPop closed 6 years ago

PoppyPop commented 6 years ago

BugFix Add the same functionality for TV shows and movies (Auto-library add) Add perf optimisation options to handle huge initial library scan

LukePulverenti commented 6 years ago

Why switch to the model of manually setting parent ids and season ids? This is really not good. It is best to just copy the files in and let the normal library scanning process take it from there.

PoppyPop commented 6 years ago

Multiple reasons :

For the solution

Just give me the good path, but the parenting of Series is mandatory if we want to refresh metadata.

LukePulverenti commented 6 years ago

We shouldn't have the parenting. The primary purpose of this plugin is to be an automated alternative to manually copying a new file into a library folder. If there are any issues in that process then it is likely to be a core issue and should be reported accordingly. It's not the plugin's responsibility to try and work around it.

PoppyPop commented 6 years ago

I reworked the change, Removing all auto-add feature, as it was before. I keeped an parenting to not affect user and i will open an proper issue for the emby core.

For the responsibilty of the plugin, i think it's very hard to know if it's the plugin responsablity or the core for the parenting issue, the public api, provide an AddChild, wich make the job in an esay way.

PoppyPop commented 6 years ago

Ok, i restart from the beginning, in the AutoOrganize plugin there was a code that search for the Series, it was existing, when i add the Movie Organize function, i noticed my library was inconsistent because of duplicate. I made a temporary fix with the AddChild. I repeat Temporary.

I can remove the AddChild, but is like saying to the users, i will create duplicates. I can remove the MetadataRefresh on series, but this will lead to a remote call for each episodes, and lead to timeout and performances issues.

I repeat it a second time, i speak about existing code, that make duplicates, not a new functionality. (MediaBrowser/Emby.AutoOrganize#8) As you can see, i removed all other addChild.

LukePulverenti commented 6 years ago

I asked you to open a bug report in the core because I didn't catch that you are calling AddChild. After further review, I see you are still using that, and it should be removed.

LukePulverenti commented 6 years ago

As far as performance - if the same situation would happen when manually copying in a new video file, then yes the RefreshMetadata should be removed from the plugin.

PoppyPop commented 6 years ago

The same situation would not happen, it's a Series refresh and not an episode Refresh. When you copy, one or multiple episode, the series would be added one time, and each episode added and refreshed.

If i remove the existing code it will result in :

This field will always lack the identified series until a library scan image

We must find the good compromise between performances and user functionality.

For references, i checked the library scan, it make 1 Series RemoteCall per Series, 1 Episode RemoteCall per Episode.

PoppyPop commented 6 years ago

Response Part 2 : I tried to make a local series cache, so i can keep good performance and i do not relies on media library and parenting. The result is worse, now i understand why the plugin NEED to refresh Series metadata. The Code use providerManager.GetRemoteSearchResults<Episode, EpisodeInfo> method to obtain episode information. I lookup at the base code of TvdbEpisodeProvider and OmdbEpisodeProvider, they do not make any remote call, they relies to the metadata generated by the Series refresh.

When removing the metadata refresh, no episode can be identified, each research give no result. Obviously, the plugin become useless in this case.

I we see the Series MetaData Refresh is Mandatory, so we come back to the parenting issue.

In my vision there is 2 possible solutions :

I removed the parenting from the PR

PoppyPop commented 6 years ago

Hello,

Any news ? (I removed the parenting from the PR)

LukePulverenti commented 6 years ago

Can you check spelling on the html - comlpetion for example. Thanks.