LMH need help! Help plz ... How select episodes in Online Rating sort order (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    11,819
    6,671
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #1
    Help plz ... How select episodes in Online Rating sort order, asc or desc, i try:
    C#:
              SQLCondition conditions = new SQLCondition();
              conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cSeriesID, 0, SQLConditionType.GreaterThan);
              conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cHidden, 0, SQLConditionType.Equal);
              conditions.Add(new DBOnlineEpisode(), DBOnlineEpisode.cRating, 0, SQLConditionType.GreaterThan);
              conditions.AddOrderItem(DBOnlineEpisode.Q(DBOnlineEpisode.cRating), SQLCondition.orderType.Descending);
              logger.Debug("*** Rated: " + conditions.ToString());
    
              episodes = DBEpisode.Get(conditions, false);
              if (episodes == null || episodes.Count == 0)
              {
                logger.Debug("*** Rated Failed... Try another...");
                episodes = DBEpisode.Get(conditions);
              }
    But no result :(
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,922
    1,228
    Saratov
    Russian Federation Russian Federation
    Country flag
    I never understand that syntax...
    If it's ordinary list of episodes you could try LinQ methods:
    C#:
    use System.Linq;
    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:
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,819
    6,671
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #3
    Dunno if string type for Rating suits for sorting. Maybe you should convert it to double first
    I need TVSeries local episodes for fill latests ...

    list.OrderBy(x => x[DBOnlineEpisode.cRating]).ToList()
    Это работает? Или получить все подряд, затем сортировать и анализировать?
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,819
    6,671
    Kyiv
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #10
    Code looks the same as ltfearme linked
    I need sort by Online Episode field:
    C#:
    conditions.AddOrderItem(DBOnlineEpisode.Q(DBOnlineEpisode.cRating), SQLCondition.orderType.Descending);
    ltfearme code only sort by Local_Episode field ...:
    C#:
    condition.AddOrderItem(DBEpisode.Q(DBEpisode.cFileDateCreated), SQLCondition.orderType.Descending);
    ...
    condition.AddOrderItem(DBEpisode.Q(cFileDateAdded), SQLCondition.orderType.Descending);
    ...
    condition.AddOrderItem(DBEpisode.Q(DBEpisode.cDateWatched), SQLCondition.orderType.Descending);
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    X [solved] Display needs to be turned on for TV services to function General 1
    J IPTV Sweden, need help with m3u list MediaPortal 1 Plugins 14
    N Play a TV recording needs a double selection - twice ok on remote Television (MyTV frontend and TV-Server) 2
    L [solved] Why does Mediaportal 2 need access to my webcam? General 2
    U [solved] Beginner needs help recording live TV General 19
    mrmojo666 beginner: trying to write a plugin, need help to catch event General Development (no feature request here!) 3
    M What does MP homeserver detection need at the client end, and what does the server need to transmit? General 6
    S EPG timeshift advice needed please Electronic Program Guide 3
    el Filou Is Windows Media Player still needed on Windows 10 ? MediaPortal 1 Talk 0
    milagroso Remote control with EventGhost - I'm stuck, need help General 3
    W Need help getting my TV guide working again General Support 1
    morpheus_xx [Evaluate] LIVE555 library vulnerability - do we need to update?! Developer Discussions 7
    A I need help with 110 and 119 west Installation, configuration support 21
    A Need help rescaning Channels for 110 and 119 west MediaPortal 1 Talk 2
    C EPG-Buddy: so close to no help needed Electronic Program Guide 8
    A Need new 110w and 119w tp`s Newcomers Forum 0
    M Need advice on writing plugin that modifies EPG database TV-Server 2
    S [solved] Alright, I need help with BD ISO's Newcomers Forum 19
    T Help needed troubleshooting freezing issues in Kodi/LE w Mediaportal backend Television (MyTV frontend and TV-Server) 8
    J Help with new grabber file. WebEPG 1
    wizard123 [solved] MP1 Build help MediaPortal 1 21
    D Please help with getting Schedules Direct to work Newcomers Forum 10
    A IPTV from https m3u8 urls - Help General 6
    M A little help with new install pls Installation, configuration support 3
    N Music player help Listen Music 4
    Similar threads

























    Top Bottom