|
SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Export list of watched titles?
Is there a way to export a list all titles marked watched in my imported video library?
Specifically would be great if I can get it for just titles currently in the imported media library that have been watched. I am completely not up to speed on this v9 release but I am on v7 newest with CMT, BMT and all that which are up to date as per the plugin downloader in settings. Thanks! |
#2
|
||||
|
||||
I'm sure this could be gleaned from a sagex call. Results would be JSON, most likely.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#3
|
||||
|
||||
JSON would be OK I believe, I should be able to parse that into whatever I need.
I am unfamiliar with sagex is that an addon I am not using? Is there a guide on how I might accomplish this? Thank you! |
#4
|
||||
|
||||
There's a sagex-services plugin that you install, which will then enable access to the sagetv API via a REST interface at http://(your server's address):8080/sagex/api. Guidelines on its use will be present when you navigate to that URL.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#5
|
||||
|
||||
Thanks Fuzzy, looks like I have my project for the week.
|
#6
|
||||
|
||||
I is pretty extensive, and for the most part, can do anyhting that can be done by the sagetv UI (and more). It essentially is a web based version of the entire sagetv API (documented here: http://download.sage.tv/api/sage/api...e-summary.html )
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#7
|
||||
|
||||
If you are familiar with Groovy, this would do the trick
Code:
import java.io.*; import java.util.*; import java.text.SimpleDateFormat; import sagex.remote.rmi.*; import sagex.SageAPI ; import static groovy.io.FileType.*; import sagex.api.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import org.apache.commons.io.FileUtils; // Variables String sageSystem = "HTPC-LR" ; Integer loopCounter=0 ; private RMISageAPI parseRmiSetting(String system) { String host, port; host = system ; port = "1098"; return new RMISageAPI(host, Integer.parseInt(port)); } // Start of program Main code RMISageAPI api = parseRmiSetting(sageSystem); if(api != null) { SageAPI.setProvider(api); System.err. println("# sagex-services manually set to '" + api.toString() + "'"); } for( mfAiring in MediaFileAPI.GetMediaFiles("V") ) { if ( AiringAPI.IsWatched(mfAiring) ) { println ( MediaFileAPI.GetFileForSegment(mfAiring,0).toString() + " is marked as Watched. " ) ; loopCounter++ } } println ("***************") ; println ("***** END *****") ; println ("** ${loopCounter} videos watched **") ; println ("***************") ; |
#8
|
||||
|
||||
You can do it using this url, provided you have sagex-api/sagex-services installed.
Code:
http://192.168.1.10:8080/sagex/api?c=EvaluateExpression&1=FilterByBoolMethod(GetMediaFiles(%22V%22),%22IsWatched%22,true)&filter=MediaFileID|MediaTitle The &filter just limits the data coming back to the MediaTilte and MediaFileID.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
||||
|
||||
So amazing, thank you guys!!
@graywolf, I run that in a command prompt, after installing Groovy add-in? What I'll do is install both add ins and see which one I can get working, its been a while since I dug into Sage. Its simply been running well and there's been no need. Thanks again! |
#10
|
||||
|
||||
Been a while since I did the setup but from memory:
You install Groovy (external to Sage) Install the sagex then copy the sagex-api.jar to the groovy lib directory (sagegroovy.jar is also helpful for other scripts) Groovy has a console mode (which is what I use mostly) and you can run the script from there. Or create a bat file which I run via Task Scheduler. Code:
@ECHO ON cd C:\Groovy\Scripts\WatchedFolder for /F "tokens=1-4 delims=/ " %%i in ('date /t') do ( set DayOfWeek=%%i set Month=%%j set Day=%%k set Year=%%l set Date=%%l%%j%%k ) C:\Groovy\Groovy-2.3.7\bin\groovy.bat C:\Groovy\Scripts\WatchedFolder\ListWatchedVideos.groovy >"C:\Logs\SageTV\ListWatchedVideos_%Date%.txt" 2>&1 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I Export a list of recorded TV? | brandypuff | SageTV Software | 15 | 05-27-2016 10:24 AM |
Export Media List | trk2 | SageTV v7 Customizations | 3 | 09-10-2015 08:23 AM |
Watched Status export/sync with Trakt? | Jason | SageTV v7 Customizations | 0 | 06-08-2013 06:17 AM |
Export a list of imported videos | [JiF]Mike | SageTV Software | 3 | 02-19-2008 04:20 PM |
Export "watched" show list? | blackbear | SageTV Software | 0 | 10-27-2003 05:44 PM |