Store language(s) from MediaInfo | Page 6

Discussion in 'My TVSeries' started by Edalex, January 31, 2015.

  1. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    I have been looking into where the Online_Parsing_Classes.OnlineAPI.SelLanguageAsString is been used, and changed it to use the Series preferred language, if an override exists.



    But in GetRandomBanner() in imageAllocator.cs I can't know witch Series the call has been done for. So the random get less random when the specific Series language is not "en" (and the random option is enabled)

    In the CompareTo() in GetBanner.cs (you posted the code for it in an earlier post here) I don't know if I should change this?
    Because I don't find anywhere it's used?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    It's used when .Sort() is called e.g
    Code (Text):
    1.  
    2. // sort by highest rated
    3. widebannerSeriesList.Sort();
    4.  
     
  4. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    Are you testing after an Import?

    I tried your GUI Options Toggle (it takes a long time by the way so its probably better ensuring it takes the same path as the import one which is way faster). It may be better to just not have the option toggle, and only allow user to change from configuration.

    Anyway the results are different and even though it looks correct for 12 Monkeys, it some how got a negative result for 24.

    There is an option to skip counting on unaired episodes or episodes without air-dates, its most likely because of that. I have 'count episodes that have no air date or air in the future' off.

    Here is what I would recommend, remove the option from OPTIONS in the GUI. Just concentrate on fix for the series/season counting when an import is done.
     

    Attached Files:

    • option_off.jpg
      option_off.jpg
      File size:
      512.6 KB
      Uploaded:
      March 24, 2015
      Views:
      85
    • option_on.jpg
      option_on.jpg
      File size:
      512.3 KB
      Uploaded:
      March 24, 2015
      Views:
      84
  5. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    I had a look at the code and can see the logic issue, you were never incrementing the series unwatched count unless the option was enabled
    Code (Text):
    1.  
    2. if ( (season[DBSeason.cIndex] != 0) && (DBOption.GetOptions(DBOption.cCountSpecialEpisodesAsWatched)) )
    3. {
    4.    seriesEpsUnWatched += unWatchedCount;
    5. }
    6.  
    In that case if cCountSpecialEpisodesAsWatched was disabled then unwatched at the series level will always 0.

    I think what you intend is something like:
    Code (Text):
    1.  
    2. if ( (season[DBSeason.cIndex] != 0) || (season[DBSeason.cIndex] == 0 && !DBOption.GetOptions(DBOption.cCountSpecialEpisodesAsWatched)))
    3. {
    4.    seriesEpsUnWatched += unWatchedCount;
    5. }
    6.  
    Here is will always increment if not a special, and if it is a special then only increment unwatched if the option is disabled.
     
  6. Edalex
    • Premium Supporter

    Edalex Community Plugin Dev

    Joined:
    January 3, 2008
    Messages:
    2,903
    Likes Received:
    709
    Gender:
    Male
    Location:
    Saratov
    Ratings:
    +1,223 / 9
    Home Country:
    Russian Federation Russian Federation
    Show System Specs
    What about splitting code for handling specials and languages?
     
  7. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    You right, I manage to reproduce the problem you got!

    The problem you have occurs when the:
    • "Count episodes that have no AirDate or air in the Future" is OFF
    • "Count the Special (Season 0) episodes as watched" is ON
    This occurs regardless of you're suggested change of code.
    What we can do, is to group this two?

    How many Series do you test on?
    I have today 6 Series in my test environment, but I should maybe test with more?

    Is this still you're recommendation about the case?
    For me it sounds fear, because either you use it, or you don't!
    (like the "Count episodes that have no AirDate or air in the Future" option).
     
  8. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    Yeah... it had been the cleaner way! But I missed that the artwork had a language property, so I started the "handing specials" after I thought I was finished with the language changes for the Series. Then @ltfearme asked about the Artwork :eek:

    So I'm to blame here :oops:
    But I'm starting to patch up the glitches now ;)
     
    • Thank You! Thank You! x 2
  9. Edalex
    • Premium Supporter

    Edalex Community Plugin Dev

    Joined:
    January 3, 2008
    Messages:
    2,903
    Likes Received:
    709
    Gender:
    Male
    Location:
    Saratov
    Ratings:
    +1,223 / 9
    Home Country:
    Russian Federation Russian Federation
    Show System Specs
    /offtopic
    Damn, your enthusiastic work reminded me of my unfinished Remapper feature for MP-TVSeries. :unsure:
    I have to finish it!
     
    • Like Like x 1
  10. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    Over 200 hundred. Yes you should test with more, it will show that the execution path taken it is not optimised when you do the option toggle vs the import execution path.

    Import:
    Code (Text):
    1.  
    2. var episodesForCount = DBSeries.GetEpisodesForCount();
    3. foreach (DBSeries series in allSeries)
    4. {
    5.    DBSeries.UpdateEpisodeCounts(series, episodesForCount);
    6. }
    7.  
    The Option Toggle you Added:
    Code (Text):
    1.  
    2. foreach (var series in allSeries)
    3. {
    4.    int epsTotal = 0;
    5.    int epsUnWatched = 0;
    6.    DBEpisode.GetSeriesEpisodeCounts(series[DBSeries.cID], out epsTotal, out epsUnWatched);
    7.    series[DBOnlineSeries.cEpisodeCount] = epsTotal;
    8.    series[DBOnlineSeries.cEpisodesUnWatched] = epsUnWatched;
    9.    series.Commit();
    10. }
    11.  
    As you can see its two different paths. The reason why its faster is because DBSeries.GetEpisodesForCount(); does the database query needed for all series, where as you're doing a query on every single series.
     
    • Informative Informative x 1
  11. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    What I will do is remove the Option in GUI, because this is the same type of feature as "Count episodes that have no AirDate or air in the Future". And that type you either have it ON or OFF.

    Then I will do a some test on a bigger collection!
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!