From caa7993bc3428cd81c672d66e042bb320bce9875 Mon Sep 17 00:00:00 2001 From: Peter Bennett Date: Thu, 9 Nov 2023 12:04:24 -0500 Subject: [PATCH] service api GetVideoList: Fix bug Bug in code to cater for directories starting with slash. --- mythtv/programs/mythbackend/servicesv2/v2video.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mythtv/programs/mythbackend/servicesv2/v2video.cpp b/mythtv/programs/mythbackend/servicesv2/v2video.cpp index 4fcfe5cadb7..c1b04496ba0 100644 --- a/mythtv/programs/mythbackend/servicesv2/v2video.cpp +++ b/mythtv/programs/mythbackend/servicesv2/v2video.cpp @@ -260,6 +260,8 @@ V2VideoMetadataInfoList* V2Video::GetVideoList( const QString &Folder, sql.append(sort); if (partList.length() > 1 && partList[1].compare("DESC",Qt::CaseInsensitive) == 0) sql.append(" DESC"); + else if (partList.length() > 1 && partList[1].compare("ASC",Qt::CaseInsensitive) == 0) + sql.append(" ASC"); else sql.append(defSeq); next = true; @@ -339,8 +341,8 @@ V2VideoMetadataInfoList* V2Video::GetVideoList( const QString &Folder, if (CollapseSubDirs) { QString fnPart = metadata->GetFilename().mid(folderlen); - int slashPos = fnPart.indexOf('/'); - if (slashPos > 0) + int slashPos = fnPart.indexOf('/',1); + if (slashPos >= 0) continue; }