rrirower / DP2SceneGraphWizard

Direct Publisher to SceneGraph wizard.
MIT License
15 stars 1 forks source link

"order" in Content Categories not sorting right #69

Closed jsonnentag closed 4 months ago

jsonnentag commented 7 months ago

One more item isn't working like it should (or not working like it does whit Direct Publisher processing things anyway).

The "order" field has 4 options, 3 of which are automated. I noticed that some Categories on another channel were not ordered right and went to look at the Content Categories I had in the JSON feed. The first problem was that I had all of them marked as "most_recent" when about 4 of them should have been "chronological" - so I changed the option to chronological and re-created the channel and side loaded the new version to a Roku device.

BUT . . . nothing changed in the channel Categories created. Everything was still displayed as "most_recent".

In the Direct Publisher processing of feeds it bases "chronological" on either the "releaseDate" or "dateAdded" (I really don't know which because I always set them to the same date). But in the wizard it doesn't seem to matter what it is set to ("most_recent" and "chronological" seem to produce the same results.

Here is the feed I am working with. The first Category (most recently produced things) is supposed to be showing the most recent items first (which it does - and it also happens to be the order they appear in the feed, I always add the new stuff to the top). But the next 4 Categories SHOULD be sorted and listed based on the "chronological" option. So the episode numbers should count up rather than backwards (like the first category is).

184-161 121-160 81-120 41-80 1-40

http://sabbathschooltv.com/roku/whatsupprof.json

At some point I'm going to have to rework the whole thing and list everything by years or something.

But that reminds me of another thing I have been wondering. Is there any limit on how many items can be in a Category in a row now? Roku always said there was a limit of 40 for some reason.

Also, can there be more than 15 Categories/rows now? They also imposed that limit for some reason. (???)

jsonnentag commented 7 months ago

I also just noticed that another Category ("Francois du Plessis Series") is supposed to be listed by "most_recent" but I think that everything is just listed in the order the Series appear in the feed. So really no ordering of things at all. That would explain why the first 5 Categories are all listed as "most_recent" too (since that is the order each appears in the feed - latest always added to the top).

rrirower commented 7 months ago

This will be looked into as an enhancement. It will not make the next version.

jsonnentag commented 7 months ago

Looking more "exactly" at the JSON feed specification and on how things work with DP now I would guess that the "dateAdded" is used for sorting by DP, because when I've added new things to a series it always bumps it up to the front of the Latest Category list again.

Episodes in a Series have both "releaseDate" and "dateAdded" while the Series itself only has a "releaseDate". It would be nice if the JSON feed specification was more EXACT in its description.

https://developer.roku.com/docs/specs/direct-publisher-feed-specs/json-dp-spec.md#category

The order of the category. Must be one of the following:

manual: For playlists only
most_recent: reverse chronological order
chronological: the order in which the content was published (e.g., Episode 1, Episode 2, etc.)
most_popular: sort by popularity (based on Roku usage data).
rrirower commented 5 months ago

@jsonnentag I think I have a fix for this. Would you be willing to test it before I release it?

jsonnentag commented 5 months ago

@jsonnentag I think I have a fix for this. Would you be willing to test it before I release it?

OK.

I was about to start testing out the latest version you created, so might as well test out this fix too. :)

rrirower commented 5 months ago

Thanks. I will put together a zip package for you tomorrow. You'll need to add your manifest to it. This test version sorts items in the grid row based on the 'releaseDate' field.

rrirower commented 5 months ago

@jsonnentag Please add your manifest to this zip file and test it. Each grid row is sorted on the 'releaseDate' field in the JSON feed file. Rows that specify 'manual' are not affected. Let me know if this sorts correctly. If so, I'll make it generally available.

DPtoSceneGraph.zip

jsonnentag commented 5 months ago

OK, I tested it out and I see why it was giving some strange results. I'll attach the manifest file so you can see the same thing. But I think it is working according to how you set it up, just not the same as the original DP setup. I think DP from Roku used the full date and time of "dateAdded" rather than "releaseDate".

I was looking at the first 3 rows of content and thinking everything is looking good, then I got to the rows for "Episodes: 41-80" and "Episodes: 1-40" and things looked scrambled. But that is because I added those to the JSON file all at one time after they had a lot of episodes and since I didn't go and figure out what date they really released them I just went with a date and then added 1 hour to the "dateAdded" value so that they would be listed in order.

*** The first row is sorted the opposite of the others, because it has the latest episodes. I just wanted the latest to be first and most easily accessible. Sometime I need to rework the whole arrangement of things and make it a series with years as seasons.

So I don't know if you would want to change that sorting to be based on "dateAdded" and also based on the time along with the date or just tell people what to expect to be used for the sorting and that it isn't the same as the original DP. I could easily go through things in the JSON feed and change the "releaseDate" values to sequential dates.

(Apparently you can't select a file to attach if it doesn't have an extension, so I just added .txt and you can delete it after DL.) :) manifest.txt

rrirower commented 5 months ago

I'll take a look at what, if anything, I can use from the 'dateAdded' field.

I'm not sure using 'dateAdded' is appropriate, in my opinion, since it simply means the date the content was added to the feed file. That's why it is part of the Content object. 'releaseDate', however, is on the base level of the object and provides the date the content was first made available to the public.

You can, however, achieve some of you goal by defining a 'Newly Added' (playlist) category to control the order of new content.

Lastly, your manifest file indicates you're using a old version. As such, you're missing out on some new features.

jsonnentag commented 5 months ago

I had to view the JSON Feed Specification to see what they "really" SAY (not that they construct things based on what they say . . .) and they describe things to function the way that you set things up, even though they used the "dateAdded" for their sorting when they claim that the sorting was done based on "releaseDate". Just in case they say things differently in other places, this is where I found the following:

https://developer.roku.com/docs/specs/direct-publisher-feed-specs/json-dp-spec.md#shortformvideo

"releaseDate" - string - Required - The date the video first became available. This field is used to sort programs chronologically and group related content in Roku Search. Conforms to ISO 8601 format: {YYYY}-{MM}-{DD}. For example, 2020-11-11

https://developer.roku.com/docs/specs/direct-publisher-feed-specs/json-dp-spec.md#content

"dateAdded" - string - Required - The date the video was added to the library in the ISO 8601 format: {YYYY}-{MM}-{DD}T{hh}:{mm}:{ss}+{TZ}. For example, 2020-11-11T22:21:37+00:00.

This information is used to generate the “Recently Added” category.

I still haven't looked at the latest "beta" you created. Did you ever create a "Recently Added" category option? I think that is about one of the last things I could see that was in the original DP but I hadn't seen in the files you created. It wasn't like a super critical/necessary thing, but it is kind of nice for people to be able to see what is new when there are a pile of things to sift through. :)

rrirower commented 5 months ago

When I was maintaining a DP channel, I would define a playlist row that contained all newly added content. Each month or so, I would update the list by adding new items and removing "old" ones.

rrirower commented 4 months ago

Resolved in beta.5 release.