SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v9 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v9 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 9 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 9 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-26-2017, 08:52 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
Sagex API intelligent sort question

I'm trying to obtain the last 10 media files that Sage has scanned to display to the user-interface in my Home Assistant front-end.

Thus far i'm using:
Code:
curl "http://localhost:8080/sagex/api?c=EvaluateExpression&1=Sort(GetMediaFiles(\"TVDB\"),false,\"Intelligent\")&size=10&encoder=json"
as a command_line sensor, which seems to get pretty close. but i get some odd results, especially if a file is currently recording. it seems to return some additional entries, that aren't real mediafile objects, and have weird AiringStartTime values, (ie: 11:70am).

Capture.PNG

So a couple of questions:

1) what does the "Intelligent" parameter of the Sort function actually do? i can't seem to find any info on that.
2) what could be causing the odd results when currently recording, and how might i filter those out of the result set?
3) any better ways to do this via sagex? i don't seem to find a "Date-Added" or any similar field in Sage...i'm currently settling on Airing:AiringStartTime.
__________________

Server: Sage 9.0.13.536, Windows10-64bit, AMD Phenom II X4 905e 2.5GHz , 16GB Ram, 2.6TB recording
Tuners: OpenDCT 0.5.2 Ceton InfiniTV4
NAS: 16TB, unRaid Plus, Asus H87I-Plus mini-ITX, Intel Core i3-4130, 16GB Ram, Fractal Node 304 case
10 Clients: HD-300, HD-200, SageWin10, Plex, AndroidMiniClient
Reply With Quote
  #2  
Old 10-27-2017, 08:21 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I hate the Intelligent sorting myself but is the default in Sage, particularly in the web UI. Why would I want to see a Manual recording from 10 years ago before a Favorite recorded an hour ago? If I were you I would sort by Newest Recordings, to do this you may have to sort by Time and reverse the sort order.

The SageTV manual describes this in detail as:
Quote:
Intelligent – The list will be sorted by SageTV’s recording priority. Manual recordings
are listed before Favorites, then Intelligent Recordings and live TV, followed by watched
shows, with shows marked as Don’t Like listed last. Within each of those sections, the
newer recordings are listed first. The Reversed form of this style simply reverses the sort
order.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #3  
Old 10-27-2017, 03:23 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by wayner View Post
I hate the Intelligent sorting myself but is the default in Sage, particularly in the web UI. Why would I want to see a Manual recording from 10 years ago before a Favorite recorded an hour ago? If I were you I would sort by Newest Recordings, to do this you may have to sort by Time and reverse the sort order.

The SageTV manual describes this in detail as:
I agree with this.

I always set the recordings display as newest first and upcoming recordings as oldest first.
__________________
"Keep your goals away from the trolls"
Reply With Quote
  #4  
Old 10-27-2017, 06:13 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
i filtered out the currently recording results, and left the "Intelligent" parm in. So far, it seems to be doing what i want. But i'll keep these replies mind should i see some weirdness, and use AiringStartTime or similar.

thanks.
__________________

Server: Sage 9.0.13.536, Windows10-64bit, AMD Phenom II X4 905e 2.5GHz , 16GB Ram, 2.6TB recording
Tuners: OpenDCT 0.5.2 Ceton InfiniTV4
NAS: 16TB, unRaid Plus, Asus H87I-Plus mini-ITX, Intel Core i3-4130, 16GB Ram, Fractal Node 304 case
10 Clients: HD-300, HD-200, SageWin10, Plex, AndroidMiniClient
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sagex question - turning on extenders wayner SageTV v9 Customizations 9 09-15-2017 07:30 AM
sagex-api Plugin MISSING: sagex-api-FAILED http://ubuntone.com/5NNCHGlywxvXBgRw8B3nMr antplugger SageTV v7 Customizations 10 06-10-2014 01:34 AM
Sort By Recent Activity Vs Sort by Original nyplayer Gemstone for v7 10 04-03-2013 11:53 AM
Intelligent recording management question planetc SageTV Software 6 05-24-2010 04:23 PM


All times are GMT -6. The time now is 05:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.