Jump to content

Emby: Continue Watching Logic for New Episodes/Series


Go to solution Solved by GrimReaper,

Recommended Posts

grzes2411
Posted

In Emby, for a TV series to appear in the 'Continue Watching' section after a new, unwatched episode is added, does there need to be at least one watched episode file within the series, or is the season folder alone sufficient? What about new series with only one season?

  • Solution
GrimReaper
Posted
1 hour ago, grzes2411 said:

In Emby, for a TV series to appear in the 'Continue Watching' section after a new, unwatched episode is added, does there need to be at least one watched episode file within the series

Yes. 

1 hour ago, grzes2411 said:

or is the season folder alone sufficient?

It's not. 

1 hour ago, grzes2411 said:

What about new series with only one season?

Same applies. 

Posted

HI, for now yes, but we will improve this in future updates. Thanks.

grzes2411
Posted

Hello,

I've created a Python script that uses Emby ScripterX. Its purpose is to add a "S01E01.disc placeholder file" to a series (when I add a new, unwatched episode to a series I'm already watching, and there are no other watched episodes in that series folder). This is to ensure the series appears in the "Continue Watching" section.

I'm encountering an issue with one specific scenario:

  • Scenario: If I already have a S01E01.disc placeholder file in a series folder, and then I add a real S01E01 episode, and then I query the Emby API using this endpoint: http://[YOUR_EMBY_SERVER_IP]:[EMBY_PORT]/emby/Users/[YOUR_EMBY_USER_ID]/Items?ParentId=[PARENT_ID_E.G._SHOW_SEASON]&IncludeItemTypes=Episode&Fields=UserData,ParentIndexNumber,IndexNumber,Path&Recursive=true&api_key=[YOUR_EMBY_API_KEY]

    Emby's API seems to return only the first S01E01 that was added (the placeholder), even though on the Emby web interface, both S01E01 files are visible and I can choose which one to watch. This suggests Emby knows there are two S01E01 items.

    Question 1: Is there a way to modify my API query or do something else to make the API return both S01E01 files?

My second question is about ScripterX configuration:

Question 2: How do I precisely configure ScripterX to send arguments only for series, seasons, and episodes? Currently, I've had to implement exceptions within my Python script because, after trying to configure it in ScripterX, it wasn't sending any arguments at all.

Beztytuu.thumb.jpg.40d8a95facafce4bc400fba72bab68f9.jpg

Any help would be greatly appreciated!

Posted

Hi- question 1 you can’t. They get grouped together. If you’re using the api then you need to implement support for alternative media sources. Both will be available in the list of media sources, so you can access from there.

 But ideally I would delete the disc version.

Posted

But question 2 I would ask this in the dedicated topic for the plugin because it will get a lot more visibility there from people who are best equipped to help.

grzes2411
Posted
Quote

But ideally I would delete the disc version.

Yes, but I'd like to do it automatically.

 

Quote

If you’re using the api then you need to implement support for alternative media sources. Both will be available in the list of media sources, so you can access from there.

Regarding your answer about "alternative media sources" for Question 1:

If by "alternative media sources" you mean the MediaSources field in the API query, I've already tried that. I updated my API request to include &Fields=UserData,ParentIndexNumber,IndexNumber,Path,MediaSources for a series where I know for certain both the S01E01.disc placeholder and a real S01E01 file exist in the same folder.

However, the API response for the S01E01 episode still only shows a single entry within the MediaSources list, specifically the path to the S01E01.disc placeholder. The real S01E01 file is not listed in MediaSources for that item, even though both are visible in the Emby web interface.

Could you please clarify if "alternative media sources" refers to something other than the MediaSources field, or if there's another way to access both file paths via the API in this specific scenario?

Posted

Try also requesting the field AlternativeMediaSources, and then the MediaSources list should come back with the alternatives.

grzes2411
Posted
Quote

Try also requesting the field AlternativeMediaSources, and then the MediaSources list should come back with the alternatives.

 

Thanks for the suggestion to use AlternativeMediaSources.

I've tested the API with various Fields combinations, including:

  • MediaSources

  • AlternativeMediaSources

  • Both MediaSources and AlternativeMediaSources together

  • And even All fields.

In all cases, when both S01E01.disc and a real S01E01 file are present in the folder, the API response for the S01E01 item still only shows the S01E01.disc file. The real S01E01 is never listed in MediaSources (or any other field) for that item, despite both being visible in the Emby web UI.

Posted

Well when you open the episode detail screen, do you see the version selection drop down box?

grzes2411
Posted
Quote

Well when you open the episode detail screen, do you see the version selection drop down box?

Yesimage.jpeg.c55db2b2bab2d117647a0205db98d931.jpeg

Posted

@quickmicyou're able to get the alternates all in one request, right?

quickmic
Posted (edited)
15 hours ago, Luke said:

@quickmicyou're able to get the alternates all in one request, right?

@grzes2411

Yes, my episode API call includes the following "fields" parameters:

SpecialEpisodeNumbers,ParentId,Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,Video3DFormat,OfficialRating,PremiereDate,ProductionYear,DateCreated,People,Overview,CommunityRating,CriticRating,ShortOverview,Tags,ProviderIds,RemoteTrailers,MediaSources,PresentationUniqueKey,OriginalTitle,AlternateMediaSources,PartCount,SpecialFeatureCount,Chapters,UserDataPlayCount,UserDataLastPlayedDate

This should return all mediasources.

Can you please post your actual server query and the response for review (mask the API key).

Edited by quickmic
  • Thanks 2
grzes2411
Posted

Thank you for your help with the issue regarding S01E01.disc and the real S01E01 file not both showing in the API response.

The problem is now resolved! It turns out that when I initially implemented the AlternativeMediaSources field, I had literally copied it with the "i" (Alternative).

After changing the field name to the correct spelling: AlternateMediaSources (without the "i"), the API now properly returns both the .disc placeholder and the real .mkv file within the MediaSources array for the S01E01 episode.

Thanks again!

  • Like 1
  • Thanks 1

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...