Sorting the CNN list by latest

Internet TV, Radio, Podcasts
Post Reply
samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Sorting the CNN list by latest

Post by samsungfan »

Currently I see the CNN podcast items sorted alphabetically. Is there a way to show the latest news items at the top of the list instead of the alphabetical order?
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Sorting the CNN list by latest

Post by Eugene »

samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Re: Sorting the CNN list by latest

Post by samsungfan »

I dont see the Create date populated in the table view. Is it expected to be populated. I still see the items sorted by title. I tried changing FolderItem.Sort('mpTitle/-mpCreateDate') in create podcast feed script but it didnt help.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Sorting the CNN list by latest

Post by Eugene »

samsungfan wrote:I dont see the Create date populated in the table view. Is it expected to be populated. I still see the items sorted by title. I tried changing FolderItem.Sort('mpTitle/-mpCreateDate') in create podcast feed script but it didnt help.
Perhaps you are using an older version CNN
samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Re: Sorting the CNN list by latest

Post by samsungfan »

I double checked the script and it does contain your changes regarding adding the createDate but it doesnt seem to reflect in the table grid view.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Sorting the CNN list by latest

Post by Eugene »

samsungfan wrote:I double checked the script and it does contain your changes regarding adding the createDate but it doesnt seem to reflect in the table grid view.
What folder of CNN?
samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Re: Sorting the CNN list by latest

Post by samsungfan »

All folders of CNN. I am able to see the create date only in Comedy Central items. I am not able to see the create date in other scripts like Fox, etc either.
samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Re: Sorting the CNN list by latest

Post by samsungfan »

I think it is expecting a string type instead of date type
samsungfan
Posts: 62
Joined: Thu Dec 30, 2010 5:55 am

Re: Sorting the CNN list by latest

Post by samsungfan »

I added the date as a prefix to the title to fix it for now.
davrust
Posts: 6
Joined: Mon Mar 21, 2011 11:39 pm

Re: Sorting the CNN list by latest

Post by davrust »

I also ran into this issue with the date on CNN posts, so I changed my copy of the cnnvideo.wdf script to display the date in front of the podcast (with a leading "x" to indicate old news from previous days). Now it always displays today's news first:

old code
VideoItem := WmsCreateMediaItem(sVideoLink, FolderItem.ItemID);
if (VideoItem <> nil) and SameText(VideoItem.Properties[mpiTitle], sVideoLink) then begin
VideoItem.Properties[mpiTitle] := VideoInfo.ChildValues[&apos;tease_txt&apos;];

new code
VideoItem := WmsCreateMediaItem(sVideoLink, FolderItem.ItemID);
if (VideoItem <> nil) and SameText(VideoItem.Properties[mpiTitle], sVideoLink) then begin
if WmsRegExMatch(&apos;(\d\d\d\d\/\d\d\/\d\d)&apos;, sVideoID, sCreateDate) then
if (DateToStr(GetCreateDate(sCreateDate)) = DateToStr(Now)) then
VideoItem.Properties[mpiTitle] := sCreateDate + " " + VideoInfo.ChildValues[&apos;tease_txt&apos;]
else
VideoItem.Properties[mpiTitle] := "x" + sCreateDate + " " + VideoInfo.ChildValues[&apos;tease_txt&apos;]
else
VideoItem.Properties[mpiTitle] := VideoInfo.ChildValues[&apos;tease_txt&apos;];
Post Reply