[fixed] Series plugin : Error matching multiple episode with the same name (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi,

    From a french serie, I have 2 episodes in 2 different seasons with the same episode name :

    Kaamelott-S06E008-Lacrimosa (http://thetvdb.com/?tab=episode&seriesid=79175&seasonid=134401&id=1205741&lid=17)

    and

    Kaamelott-S01E095-Lacrimosa (http://thetvdb.com/?tab=episode&seriesid=79175&seasonid=16162&id=329526&lid=17)

    Unfortunately, the Series plugin stops it's work at the 1st matching episode name, and always match S01E095 rather than the right episode. I also checked with Kaamelott-S06E08-Lacrimosa but it does not change the problem.

    To reproduce, just name a file "Kaamelott-S06E008-Lacrimosa" in a test share...

    And yes I know! French are strange people...
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Ok, I can confirm this issue. It's documented in code, but probably a lookup of episode numbers by title should not be done at all?
    Code:
    	protected bool TryMatchEpisode(SeriesInfo seriesInfo, TvdbSeries seriesDetail)
    	{
    	  // We deal with two scenarios here:
    	  //  - Having a real episode title, but the Season/Episode numbers might be wrong (seldom case)
    	  //  - Having only Season/Episode numbers and we need to fill Episode title (more common)
    	  TvdbEpisode episode = seriesDetail.Episodes.Find(e => e.EpisodeName == seriesInfo.Episode);
    	  if (episode != null)
    	  {
    		seriesInfo.SeasonNumber = episode.SeasonNumber;
    		seriesInfo.EpisodeNumbers.Clear();
    		seriesInfo.EpisodeNumbers.Add(episode.EpisodeNumber);
    		SetEpisodeDetails(seriesInfo, episode);
    		return true;
    	  }
     
    	  episode = seriesDetail.Episodes.Find(e => e.EpisodeNumber == seriesInfo.EpisodeNumbers.FirstOrDefault() && e.SeasonNumber == seriesInfo.SeasonNumber);
    	  if (episode != null)
    	  {
    		seriesInfo.Episode = episode.EpisodeName;
    		SetEpisodeDetails(seriesInfo, episode);
    		return true;
    	  }
    	  return false;
    	}

    An idea would be a check in first part, if the name is unique. Updates will be only done if it is unique.
     
    Last edited:

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Fixed
    [12:28] <MP2-GitBot> [MediaPortal-2] morpheusxx pushed 1 new commit to REWORK_SeriesMatching: http://git.io/xjoEKw
    [12:28] <MP2-GitBot> MediaPortal-2/REWORK_SeriesMatching ddc63d8 morpheusxx: Fixed series episode lookup for duplicate episode names (thanks Smeulf!)
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Confirmed : now both episodes are found.

    Thank you!
     

    Users who are viewing this thread

    Top Bottom