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
[Testing Required] update to PVR addon API 5.7.0 #76
Conversation
Remove deprecated functions, implement basic implementation for all API 5.7.0 features.
Thanks, this is now building fine with LibreELEC. The add-on now requires a subscription, so I can't really run-time test it but I'll include it in future builds in case anyone else is able to test it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. It's already looking good. There are some thing I'd like you to change, though.
pvr.filmon/changelog.txt
Outdated
@@ -1,3 +1,7 @@ | |||
2.2.0 | |||
Update to PVR addon APUI v5.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: APUI vs. API
@@ -333,6 +359,27 @@ PVR_ERROR PVRFilmonData::GetRecordings(ADDON_HANDLE handle) { | |||
return PVR_ERROR_NO_ERROR; | |||
} | |||
|
|||
PVR_ERROR PVRFilmonData::GetRecordingStreamProperties(const PVR_RECORDING* recording, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount) { | |||
P8PLATFORM::CLockObject lock(m_mutex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using a lock here, but not in PVRFilmonData::GetChannelStreamProperties
. Is that by intention?
src/PVRFilmonData.cpp
Outdated
@@ -333,6 +359,27 @@ PVR_ERROR PVRFilmonData::GetRecordings(ADDON_HANDLE handle) { | |||
return PVR_ERROR_NO_ERROR; | |||
} | |||
|
|||
PVR_ERROR PVRFilmonData::GetRecordingStreamProperties(const PVR_RECORDING* recording, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount) { | |||
P8PLATFORM::CLockObject lock(m_mutex); | |||
std:string strRecordingFile = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, no need to initialize the string with an empty string, because this what the default constructor does automatically. Applies as well to other parts of this PR.
src/PVRFilmonData.cpp
Outdated
P8PLATFORM::CLockObject lock(m_mutex); | ||
std:string strRecordingFile = ""; | ||
m_recordings = filmonAPIgetRecordings(); | ||
for (std::vector<PVRFilmonRecording>::iterator it = m_recordings.begin(); it != m_recordings.end(); it++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You easily could rewrite this as for (const auto& FilMonRecording : m_recordings)
=> C++11
Also applies to other parts of your PR.
src/PVRFilmonData.h
Outdated
@@ -69,6 +69,9 @@ class PVRFilmonData { | |||
virtual PVR_ERROR DeleteTimer(const PVR_TIMER &timer, bool bForceDelete); | |||
virtual PVR_ERROR UpdateTimer(const PVR_TIMER &timer); | |||
|
|||
virtual PVR_ERROR GetChannelStreamProperties(const PVR_CHANNEL* channel, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount); | |||
virtual PVR_ERROR GetRecordingStreamProperties(const PVR_RECORDING* recording, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation!
Thanks for looking Ksooo |
Looking good now. Thanks. Much appreciated. |
Had a second look at the implementation of GetChannelStreamProperties(), and i think i had it wrong. |
You were to quick for me. Should i just do another PR to fixup GetChannelStreamProperties()? |
No problem. Just do another PR. |
This brings the addon upto API 5.7.0 compatibility
Removed deprecated methods and stubbed out new ones
Bumped jsoncpp to 0.10.6
Please note, ive not been able to test functionality at all. If anyone can let me know if the changes work, or need further tweaking. This was a quick attempt to get up and running, so feedback is very appreciated.