Skip to content
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

Merged
merged 3 commits into from Oct 28, 2017

Conversation

fuzzard
Copy link
Contributor

@fuzzard fuzzard commented Oct 27, 2017

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.

Remove deprecated functions, implement basic implementation for all API 5.7.0
features.
@MilhouseVH
Copy link
Contributor

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.

Copy link
Member

@ksooo ksooo left a 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.

@@ -1,3 +1,7 @@
2.2.0
Update to PVR addon APUI v5.7.0
Copy link
Member

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);
Copy link
Member

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?

@@ -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 = "";
Copy link
Member

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.

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++) {
Copy link
Member

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.

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation!

@fuzzard
Copy link
Contributor Author

fuzzard commented Oct 28, 2017

Thanks for looking Ksooo
Fixed what you've requested. Do let me know if there is anything else you want changed.

@ksooo
Copy link
Member

ksooo commented Oct 28, 2017

Looking good now. Thanks. Much appreciated.

@ksooo ksooo merged commit b46f9c9 into kodi-pvr:master Oct 28, 2017
@fuzzard
Copy link
Contributor Author

fuzzard commented Oct 28, 2017

Had a second look at the implementation of GetChannelStreamProperties(), and i think i had it wrong.
Ive pushed another commit to fixup the logic that i believe should work properly.

@fuzzard
Copy link
Contributor Author

fuzzard commented Oct 28, 2017

You were to quick for me. Should i just do another PR to fixup GetChannelStreamProperties()?

@ksooo
Copy link
Member

ksooo commented Oct 28, 2017

No problem. Just do another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants