Sorting by date on Samsung QLED TV

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
mattyou
Posts: 2
Joined: Sun Nov 28, 2021 12:42 am

Sorting by date on Samsung QLED TV

Post by mattyou »

Hi guys,

I have just discovered UMS and enjoyed using it on my brand new Samsung QLED TV, but ... why can't I sort files by date ? The TV only sorts them alphabetically ... I have modified "sort_method = 1" in the configuration and fully restarted UMS, but no way to sort by date on TV ... I am pretty sure the issue is due to the TV, because on UMS Web Interface all is sorted by date.

Logs :
logs-ums.zip
(171.79 KiB) Downloaded 105 times
Please help ! :)
User avatar
mik_s
Moderator
Posts: 1114
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Sorting by date on Samsung QLED TV

Post by mik_s »

This is a problem with Samsung TVs and some other devices. They ignore the order of the file list it receives and instead shows them in alphabetical order.

There is an option for music that prepends the track number to keep them in order but there is no option to do that for videos at the moment.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
mattyou
Posts: 2
Joined: Sun Nov 28, 2021 12:42 am

Re: Sorting by date on Samsung QLED TV

Post by mattyou »

Ok thanks.

That really sucksss ! :(
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Sorting by date on Samsung QLED TV

Post by Nadahar »

Actually, what Samsung and others do is as the protocol was designed. Sorting can be done at the server or at the renderer, but in any case the renderer is meant to "be in charge" of the sorting. UMS is the one that "breaks the contract" in that it doesn't return things in the order specified by the renderer, but in the order it is configured to do.

The protocol design makes sense, because it would allow different renderers to use different sorting. The problem is that most renderers don't actually allow the user to configure sorting, which kind of undermines the whole idea. So, the result is that it's better to do what UMS does in most cases, giving you at least some control over the order, but strictly speaking what UMS doesn't follow the specification and isn't how it were designed to work.
User avatar
mik_s
Moderator
Posts: 1114
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Sorting by date on Samsung QLED TV

Post by mik_s »

OK that makes sense.

I guess the only way to do custom sorting on those devices would be an option to prepend the date or a number to each filename sent to the renderer on the fly, but not sure how easy it would be to implement or if it would mess with other functions.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Sorting by date on Samsung QLED TV

Post by Nadahar »

I don't think it would too hard, but it would take so work to make it - and it would be quite a mess when browsing. Because there can be many entries in a folder, you'd have to prefix everything with for example a pretty long number like "000000001". To get alphabetical sorting to sort things correctly, you must keep the leading zeroes, as it will sort on the first digit first.

So, I don't know if anybody would actually want to use it ;)
User avatar
mik_s
Moderator
Posts: 1114
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Sorting by date on Samsung QLED TV

Post by mik_s »

I think it would be a good idea to add that option. The leading zeros shouldn't be that bad as I guess most people will not have more than 100 in a directory so the files would be numbered 01-99, if less than 1000 it would only be 001-999.

One place I really think it should be done as default though is in the #--transcode folder--#, with 00 being 'no transcoding' to make sure it stays as the first option on all devices and keep all the other options in order.

I recently watched Squid Game and wanted the the original Korean audio with English subtitles, it took a while to find that in the transcode folder as it was dual audio, had a ton of other subtitles and I had chapters enabled. If I had all the transcoding engines enabled there would easily be over 200 options and on PS4 it is sorted alphabetically too.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Sorting by date on Samsung QLED TV

Post by Nadahar »

@mik You don't always know how many entries there are when you start listing, so you don't know how many digits to use. That's why you'd have to use a lot of digits to "be sure" that you won't run out.
User avatar
mik_s
Moderator
Posts: 1114
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Sorting by date on Samsung QLED TV

Post by mik_s »

But surely you would know exactly how many entries there are when the renderer requests a directory listing, each file will be scanned or retrieved from the database and a total count will be sent too, that is if I have understood this correctly

Code: Select all

            <NumberReturned>14</NumberReturned>
            <TotalMatches>14</TotalMatches>
            <UpdateID>26</UpdateID>
        </u:BrowseResponse>
    </s:Body>
</s:Envelope>
so you can be sure how many digits you would need. Even in worst case I doubt anyone would need more than 5.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Sorting by date on Samsung QLED TV

Post by Nadahar »

This is true except for renderers where "FasterDLNATree" (or something like that) is enabled, like the PS3. When this is the case, the renderer with just request a certain number each time, and UMS will only "resolve" (process the resources so that they can be listed, like figuring out transcoding or not, subtitles, audio tracks etc.) the number requested and will report a wrong "TotalMatches" value that is always one more than what has been retrieved (as long as there are more entries).

This is a "hack", but it makes browsing much faster for those renderers that requests media in batches. When all are requested in one go, every resource much be "resolved" before answering, which can take a considerable amount of time for large folders.

In those cases where all resources are "resolved" before a response is sent to the browse request, you do know the number of entries - but you still don't know how the folder will look in the future. The user might copy more media files into the folder, which will "invalidate" your assumption about the total number of entries. You would then have start renaming all resources in the folder, which would probably lead to a lot of confusion and potential problems.

Like I said, it can be done, with some restrictions, but I'm not sure it would be a very "slick" solution.
Post Reply