jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
201 stars 94 forks source link

Episode groups in library #354

Closed juanma-cvega closed 1 year ago

juanma-cvega commented 3 years ago

I finally found some time to test the feature. It's great to be able to search through Saint Seiya episodes by group instead of having to move through the list of episodes!! I have a question though. I realised I cannot configure groups for TV shows already in the library. Is the option meant to be configured before adding a TV show to the library? Is there anyway this option could be added to the library to rearrange the episodes whenever we want? Another thing I saw is that the grouping selected doesn't persist. I guess that'd be complicated to add to the addon as that would imply adding some kind of storage for TV shows that got changed their group view. Last thing but this is more related to Horizon (I can move this there if you think it makes sense). Once in the list of groups, the skin presents them as if they were seasons. You see number of episodes for each of them (which is the same for all cases) but in this case it'd be better to show the number of elements in the group (I don't know if that would be even possible, maybe that's controlled by Kodi). Then the options on top of the groups (Info, Overview, Managed, ...) don't make much sense in here imho as, for instance, the Info button, shows the name of the group with the plot, cast, etc, of the TV show. Maybe it'd be possible to change these options with the actual elements of each group so we can have an idea of what the group contains? Same thing with the plot, maybe replace the plot with the list of elements inside each group. Again, I don't know if this is possible at the skin level, maybe that's something that is up to Kodi to fill or maybe the skin is not prepare to have this kind of information as it looks like complete different view from the rest already available.

And would it be possible on Horizon to add an option to change the grouping once inside a TV show? The reason for this is because on TV shows that by default have only one season, when you select the TV show, you go directly to the screen with the episodes without selecting the season (I think this was an option you can enable actually). It'd be great if once on this screen you could just change the grouping so you would

jurialmunkey commented 3 years ago

I realised I cannot configure groups for TV shows already in the library. Is the option meant to be configured before adding a TV show to the library? Is there anyway this option could be added to the library to rearrange the episodes whenever we want?

Library is controlled by the scraper you use, not TMDbHelper. All TMDbHelper does is create strm files which are callback links to the player function. So no, not possible to control external things - can only control groupings inside the plugin itself.

Another thing I saw is that the grouping selected doesn't persist. I guess that'd be complicated to add to the addon as that would imply adding some kind of storage for TV shows that got changed their group view.

Yeah I think having a persistent grouping would be problematic. How it is treated at the moment is that the "episode groupings" folder is a season but inside that subfolder each grouping is then treated as a separate tvshow with its own "seasons".

Once in the list of groups, the skin presents them as if they were seasons. You see number of episodes for each of them (which is the same for all cases) but in this case it'd be better to show the number of elements in the group (I don't know if that would be even possible, maybe that's controlled by Kodi).

I think this is more a case of the Trakt watched stats being merged incorrectly. I'll need to add some special handling of the groupings to get the correct stats. Might be too much overhead to get proper watched/unwatched stats as I'd need to recalculate these separately but should be fairly easy to set the total number of episodes in each group/season.

And would it be possible on Horizon to add an option to change the grouping once inside a TV show?

Not in the library. Can't control that.

In TMDbHelper you already can (assuming you haven't disabled special seasons in the addon settings)

Honeyview_screenshot281

juanma-cvega commented 3 years ago

Library is controlled by the scraper you use, not TMDbHelper.

Ok, makes sense. In the end that would be up to the TheMovieDatabase scrapper to handle those. But I don't know if they would be willing to do that.

In TMDbHelper you already can (assuming you haven't disabled special seasons in the addon settings)

I think that's precisely my problem then.

juanma-cvega commented 3 years ago

I just posted a comment on the Kodi forum for the scraper addon asking whether groups are/could be implemented. Maybe it'd be just a matter of a naming convention of the files or an .nfo file specifying the group to use?

juanma-cvega commented 3 years ago

Apparently there is a way to configure the Episode Group to be used by the Kodi scraper. An nfo file with the URL to the episode group should be added to the library. Is this something the addon could do? It seems possible, even after the library has been already imported into the library.

jurialmunkey commented 3 years ago

Apparently there is a way to configure the Episode Group to be used by the Kodi scraper. An nfo file with the URL to the episode group should be added to the library. Is this something the addon could do? It seems possible, even after the library has been already imported into the library.

This is interesting! Though I'm not surprised it is already implemented.

It's not something I can do from TMDbHelper though because it is entirely dependent on the user using TheMovieDb as their TV show library scraper.

It looks super easy to do though. Just go to the show on TMDb and open the episode group. Get the URL from the address bar and then find the tvshow folder on your harddrive. Open the tvshow.nfo file and replace the URL it contains with the URL you got for the episode group. Then refresh the show's details from info dialog.

jurialmunkey commented 3 years ago

Turns out not as easy as I thought - it requires the filenames to be in the episode grouping order too.

juanma-cvega commented 3 years ago

It's not something I can do from TMDbHelper though because it is entirely dependent on the user using TheMovieDb as their TV show library scraper

Imo, that's something that comes with using the addon to be honest. Not using the same information provider the TV shows are being added from could cause the show not being scraped at all. With 'regular' TV shows it could work as the information is mostly the same. The episode titles may change if the show is not from an english speaking publisher but season/episode ordering is roughly the same. But for anime for instance that would just break it, which is where episode groups provides the most value. Maybe it could just be a toggle in settings, whether you want to include the nfo file when importing TV shows.

Turns out not as easy as I thought - it requires the filenames to be in the episode grouping order too.

So does that mean basically that episodes in the library would need to include a non existing season/episode ordering? I guess that would break the way the addon guesses things when playing from library. And would make it even more difficult to be able to change the episode group once already imported, wouldn't it?

jurialmunkey commented 3 years ago

Maybe it could just be a toggle in settings, whether you want to include the nfo file when importing TV shows.

My point, though, is that the .nfo is only meaningful if you use TheMovieDb scraper. Having the .nfo will do absolutely nothing at all if you are using TVDb as the scraper.

A (simplified) run down of how scrapers work:

So you see, the url is only useful if it is from the same website as the scraper being used. And if you are already using TheMovieDb scraper, then you don't have the missing episodes issue anyway because numbering matches TMDbHelper already.

All the grouping url does is tell TheMovieDb scraper that the episodes on disk are numbered according to a specific grouping rather than the default. It does nothing for the TVDb scraper.

So does that mean basically that episodes in the library would need to include a non existing season/episode ordering? I guess that would break the way the addon guesses things when playing from library.

Pretty much. You'd end up with the inverse problem where perhaps you'd get all the items to scan using TVDb but when you went to play them then TMDbHelper wouldn't find them. e.g. Say S01E20 becomes S02E01 - then you'd be asking TMDbHelper to play S02E01 which doesn't exist

And would make it even more difficult to be able to change the episode group once already imported, wouldn't it?

There is absolutely no way to change the grouping in the library after it is imported because the library relies on the naming of the files. You'd have to delete all the files, clean the library and then re-add the show with the new grouping.

juanma-cvega commented 3 years ago

My point, though, is that the .nfo is only meaningful if you use TheMovieDb scraper. Having the .nfo will do absolutely nothing at all if you are using TVDb as the scraper.

Yes, that's what I wanted to say actually. The nfo file only makes sense when using TheMovieDb scraper. In any case, someone using the addon knows what he's doing. So he knows if he's using the good scraper when enabling that toggle. In any case, as you said, the file wouldn't harm as other scrapers would just ignore it anyway and it doesn't take space.

Pretty much. You'd end up with the inverse problem where perhaps you'd get all the items to scan using TVDb but when you went to play them then TMDbHelper wouldn't find them. e.g. Say S01E20 becomes S02E01 - then you'd be asking TMDbHelper to play S02E01 which doesn't exist

That'd be the real problem with this. If files need to follow the naming convention of the group, that wouldn't be as harmless as adding an nfo file. And even using TheMovieDb as scraper, wouldn't that naming break it? I think you mentioned before episodes still follow the default convention when trying to find them. Changing the files naming to the group one would change this.

In any case, I think it'd be a great feature to be able to import TV shows with a different grouping, specially for anime, even if not allowing to change the grouping once imported. But if it's too complex to implement or it wouldn't just work with how the scrapers work feel free to close the issue.

jurialmunkey commented 1 year ago

Cleaning up some old issues.

Going to close this as it is best handled manually. The "Use alternative .nfo filename" option in the library setting will allow TMDbHelper to use a different .nfo filename so it doesn't conflict with the manually created .nfo -- then it's simply a matter of setting up Episode groups for the .strms in the same way as you would for any other library items.