LMH need help! Help plz ... How select episodes in Online Rating sort order

Discussion in 'My TVSeries' started by ajs, January 26, 2018.

  1. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,701
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,652 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    Help plz ... How select episodes in Online Rating sort order, asc or desc, i try:
    Code (C#):
    1.           SQLCondition conditions = new SQLCondition();
    2.           conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cSeriesID, 0, SQLConditionType.GreaterThan);
    3.           conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cHidden, 0, SQLConditionType.Equal);
    4.           conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cRating, 0, SQLConditionType.GreaterThan);
    5.           conditions.AddOrderItem(DBOnlineEpisode.Q(DBOnlineEpisode.cRating), SQLCondition.orderType.Descending);
    6.           logger.Debug("*** Rated: " + conditions.ToString());
    7.  
    8.           episodes = DBEpisode.Get(conditions, false);
    9.           if (episodes == null || episodes.Count == 0)
    10.           {
    11.             logger.Debug("*** Rated Failed... Try another...");
    12.             episodes = DBEpisode.Get(conditions);
    13.           }
    But no result :(


     
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. 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
    I never understand that syntax...
    If it's ordinary list of episodes you could try LinQ methods:
    Code (C#):
    1. use System.Linq;
    2. var newList = list.OrderBy(x => x[DBOnlineEpisode.cRating]).ToList();
    Dunno if string type for Rating suits for sorting. Maybe you should convert it to double first :cautious:
     
  4. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,701
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,652 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    I need TVSeries local episodes for fill latests ...

    Это работает? Или получить все подряд, затем сортировать и анализировать?
     
  5. 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
    @ltfearme are you around? :rolleyes:
    As I remember MP-TVSeries had special method for getting lates episodes specially for LMH
     
    • Thank You! Thank You! x 1
  6. 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
  7. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,701
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,652 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
  8. 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
    Highest Community Rated or User Rated ?
     
    • Like Like x 1
  9. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,701
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,652 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    Community... code in first post...

    --
    WBR, ajs :):whistle::coffee:
     
  10. 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
    Code looks the same as ltfearme linked :cautious:
     
  11. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,701
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,652 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    I need sort by Online Episode field:
    Code (C#):
    1. conditions.AddOrderItem(DBOnlineEpisode.Q(DBOnlineEpisode.cRating), SQLCondition.orderType.Descending);
    ltfearme code only sort by Local_Episode field ...:
    Code (C#):
    1. condition.AddOrderItem(DBEpisode.Q(DBEpisode.cFileDateCreated), SQLCondition.orderType.Descending);
    2. ...
    3. condition.AddOrderItem(DBEpisode.Q(cFileDateAdded), SQLCondition.orderType.Descending);
    4. ...
    5. condition.AddOrderItem(DBEpisode.Q(DBEpisode.cDateWatched), SQLCondition.orderType.Descending);
     
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!