rebhichaouki / sagetv-addons

Automatically exported from code.google.com/p/sagetv-addons
0 stars 0 forks source link

Add wasMonitored(MediaFile) API #314

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I need an API that will tell me if a MediaFile was monitored by SRE.  It 
doesn't matter if it was extended or not, just the fact that it was monitored 
or not.

Probably the easiest way to do this would be to use 
MediaFileAPI.Get/SetMediaFileMetadata() (easy to use and it cleans itself up 
when the MediaFile is deleted) but of course that's up to you.

Original issue reported on code.google.com by tom.mira...@gmail.com on 4 Dec 2011 at 2:13

GoogleCodeExporter commented 9 years ago
It would be helpful if the API functioned for MediaFiles that were being 
recorded, not just completed recordings.  (One less thing for me to check.)

Original comment by tom.mira...@gmail.com on 4 Dec 2011 at 2:20

GoogleCodeExporter commented 9 years ago

Original comment by tom.mira...@gmail.com on 4 Dec 2011 at 2:28

GoogleCodeExporter commented 9 years ago
This ability sort of already exists in DataStore:

MonitorStatus getMonitorStatus(def airing) {
        def status = getData(airing, PROP_STATUS)
        return status ? MonitorStatus.valueOf(status) : MonitorStatus.UNKNOWN
    }

Using this version (that accepts an airing instead of an id) will also work for 
MediaFiles (since the Sage API auto converts MediaFiles to Airings).

However, there's a catch: In v4, ALL recordings are monitored.  This is 
necessary to allow modifications to monitors/overrides while a recording is in 
progress.  In other words, if you start a recording of SportsCenter on ESPN 
because it's actually showing a game instead, a monitor is always created for 
every recording.  Then you can modify  the override after you start the 
recording so it starts to monitor whatever event you're actually recording.  So 
because of this, _every_ recording is now monitored - because every recording 
can have an override set on it at any time that would make it start monitoring 
an event.

Why are you looking for this info?  Maybe something can be done?

Original comment by de...@battams.ca on 4 Dec 2011 at 3:25

GoogleCodeExporter commented 9 years ago
I need this to decide if the timeline needs to be hidden or not.  I don't want 
to hide the timeline for ALL recordings, just those that were monitored by SRE. 
 Of course I was thinking about how SRE3 did things, not SREv4.  How else can I 
determine when to hide the timeline?  Maybe all sports - but that seems too 
broad. Maybe all recordings that were extended - but that gives away the 
ending.  I have no idea :(

Original comment by tom.mira...@gmail.com on 4 Dec 2011 at 3:40

GoogleCodeExporter commented 9 years ago
We're ok, I looked at the monitor thread code and it seems a monitor knows when 
it's actually monitoring something on the web for a recording or if it's just 
passively sitting there waiting for an override update.  I can add a property 
to the media file object denoting when it actually monitored something for the 
recording.

I'll add the accompanying method to DataStore as well.

Original comment by de...@battams.ca on 4 Dec 2011 at 3:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1690.

Original comment by de...@battams.ca on 4 Dec 2011 at 4:13

GoogleCodeExporter commented 9 years ago
NOTE: Created method in DataStore is named wasMonitored(mediaFile)

Original comment by de...@battams.ca on 4 Dec 2011 at 4:13

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 1c0a568f5994.

Original comment by de...@battams.ca on 22 Dec 2012 at 1:03

GoogleCodeExporter commented 9 years ago

Original comment by de...@battams.ca on 9 Apr 2013 at 2:11