New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pvr] add optional support for playing recordings from epg timeline or epg osd #3900
Conversation
@@ -79,7 +79,8 @@ bool CEpgDatabase::CreateTables(void) | |||
"iSeriesId integer, " | |||
"iEpisodeId integer, " | |||
"iEpisodePart integer, " | |||
"sEpisodeName varchar(128)" | |||
"sEpisodeName varchar(128), " | |||
"sRecordingId varchar(1024) " |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
In my opinion you should split the changes into a couple of commits. You have pure cosmetics (some minor comment changes), iterator typedefs, CPVRRecordingPtr implementation and the main PR material in one commit now. Splitting it up makes it easier to see what has really been added/changed. |
May I also suggest that you use std::string instead of CStdString, especially since you already use the former in CPVRRecordingUid. Your current approach makes for implicit casts all over the place. |
@Jalle19 thanks for the review. I'll split the commit. As for CStdString - may be it would be better to do in separate PR? I used std::string in new code that doesn't actually affect much on current implementation. |
@Jalle19 I fixed the issues you pointed out, reorganized the commits as you suggest, made recording ID of std::string type to avoid implicit casts, and also added "has recording" marker to programme search view. Could you re-review please. |
Thanks, looks way better now. I can't really comment on the main implementation since I haven't been able to test this yet, though I did notice that the changes in GUIDialogPVRGuideInfo and GUIWindowPVRCommon are very similar, infact both methods seem to accomplish the exact same thing, with the latter having a more polished implementation. @xhaggi didn't you comment on this a while back? Anyway, refactoring of that belongs in another PR. |
@Jalle19 thanks for your review, i don't have time to do this now and we need to discuss the entire idea with @opdenkamp. |
i'll review this later when i got more time. we won't change the interface until the release |
@MartijnKaijser, @xhaggi, @Jalle19 rebased and refactored. |
@xhaggi I think we should use the "epgUid" field already present in recordings. I don't think any addons use it at the moment since XBMC itself doesn't use it, but this and the code that gets a recording based on an EPG tag could use it. It would be faster too I suppose. I can pull this to a local branch and have a look. |
I meant "and the code that gets a timer based on an EPG tag" earlier. |
@@ -55,6 +55,9 @@ CEpgInfoTag::CEpgInfoTag(void) : | |||
|
|||
CPVRTimerInfoTagPtr emptyTimer; | |||
m_timer = emptyTimer; | |||
|
|||
CPVRRecordingPtr emptyRecording; | |||
m_recording = emptyRecording; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Apparently only PVR_TIMER has en epgUid member. I'd like to see it added to PVR_RECORDING too, this way we could set the recording tag for EPG items when recordings are fetched (should do the same for timers instead of the manual lookup like now, but that's for another PR). |
@@ -71,7 +71,8 @@ void CEpgDatabase::CreateTables(void) | |||
"iSeriesId integer, " | |||
"iEpisodeId integer, " | |||
"iEpisodePart integer, " | |||
"sEpisodeName varchar(128)" | |||
"sEpisodeName varchar(128), " | |||
"sRecordingId text" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
PVRRecordingMap::const_iterator it = m_recordings.find(CPVRRecordingUid(iClientId, strRecordingId)); | ||
if (it != m_recordings.end()) | ||
{ | ||
return it->second; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I think you'll need to ignore my comments about epgUid earlier, apparently it's used when adding a timer on the backend. |
correct, backend may want to link the epg data to the timer/recording too |
Fixed and rebased. Please re-review. |
@ronie could you please take a look at the confluence part, commit 6f06898 |
@vkosh except the small cleanups, it looks good. |
While looking at some of the recordings related code I'm wondering if we can just change the == operator for recordings to check only the client and recording ID. That way we wouldn't need a separate class for comparing. @opdenkamp do you know off the top of your head why a recording is only considered equal if absolutely everything matches? |
looks good to me :-) |
…ed recordings in epg timeline view, epg osd and programme search results
Rebased and polished. @Jalle19 returning to CPVRRecordingsUid with overloaded operators and recordings map implementation. Each recording can be uniquely identified by clientId+recordingId tuple provided by backend, and we need to find recordings by this tuple as fast as we can during pvr loading/updating, because each EPG tag may have associated recording (e.g. my pvr client links all past EPG's to recordings). |
You're right, I guess this is fine by me then. |
Yeah I think so. @xhaggi ? |
Cool - it'd be good to get this (plus anything else that hits epg/pvr) in before I push in the stdstring changes, as otherwise they'll all need yet another rebase. Much easier if I rebase the stdstring stuff than having a bunch of others having to rebase stuff up :) |
everything else is fine by me too. |
@xhaggi I agree, but I don't care about it enough to delay this any longer. It can always be cleaned up later if you like :) jenkins build this please |
sure ;) |
[pvr] add optional support for playing recordings from epg timeline or epg osd
@vkosh and @jmarshallnz we missed syncing the xbmc_epg_types.h with the addon repo. |
what happened to merge windows? this indeed needs to be done, the api version needs to be bumped, add-on versions needs to be bumped, and then it needs to be pulled along with the API change. I bet all PVR add-ons are now crashing. |
i'll do a PR for both |
done. #5012 and opdenkamp/xbmc-pvr-addons#331 |
This allows user to play recording through programme info dialog, which is shown by clicking on programme in the past in epg timeline or epg osd view. It also switches to a recording playback from epg search result if selected programme has one.
Programmes with associated recordings are shown with HasRecording marker (skin.confluence).
To associate recording to a programme pvr client should set recording id for corresponding epg tag. This will turn on epg updates on recordings update.
If pvr client doesn't use epg-recordings linking, then no such updates occured and everything else remains as it is now (views, switching to live stream, etc.).
If pvr backend has ability of recording everything (e.g. network pvr), then pvr client should implement its own recordings update logic to trigger recordings update on each programme end.
More info at http://forum.xbmc.org/showthread.php?tid=179792