Opened 10 years ago

Closed 10 years ago

#10006 closed Bug Report - General (Invalid)

[bug] sort Season/Episod for serie in Mythfrontend

Reported by: mgf@… Owned by:
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Sort Season-Episod don't work properly, he sort alphabetically , not numerically !

sample : 1,10,11,2,21,22......

solution (for sample) in playbackbox.cpp:

static int comp_season(const ProgramInfo *a, const ProgramInfo *b)
{
    if (atoi(a->GetSeason()) == atoi(b->GetSeason()))
        return (atoi(a->GetEpisode()) <
                atoi(b->GetEpisode()) ? 1 : -1);
    else
        return (atoi(a->GetSeason()) <
                atoi(b->GetSeason()) ? 1 : -1);
}

static int comp_season_rev(const ProgramInfo *a, const ProgramInfo *b)
{
    if (atoi(a->GetSeason()) == atoi(b->GetSeason()))
        return (atoi(a->GetEpisode()) >
                atoi(b->GetEpisode()) ? 1 : -1);
    else
        return (atoi(a->GetSeason()) >
                atoi(b->GetSeason()) ? 1 : -1);
}

Change History (3)

comment:1 in reply to:  description Changed 10 years ago by mgf@…

The error is not constant! This may be due to the passage of the version database (0.24.1 -> 0.25) I have not found a solution

comment:2 Changed 10 years ago by FabriceMG <mgf@…>

If the fields Season and Episode are filled in Recorded table, it works perfectly. But today, the backend does not fill the fields.

comment:3 Changed 10 years ago by robertm

Resolution: Invalid
Status: newclosed

This sort is for those values, and yes, they are filled when you are using the functionality correctly. You should read the commit logs to learn about the metadata lookup functionality.

Note: See TracTickets for help on using tickets.