-
Notifications
You must be signed in to change notification settings - Fork 24
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
code cleanup #69
code cleanup #69
Conversation
} | ||
} | ||
} | ||
return jsonChannel["URL"].asString(); |
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.
wrong indentation?
src/HDHomeRunTuners.h
Outdated
@@ -65,7 +65,7 @@ class HDHomeRunTuners | |||
}; | |||
|
|||
public: | |||
HDHomeRunTuners(); | |||
HDHomeRunTuners(){}; |
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.
Looks ugly without a blank between )
and {
.
src/Utils.h
Outdated
@@ -47,7 +47,6 @@ int DbgPrintf(const char* szFormat, ...); | |||
} while (0) | |||
|
|||
#define PVR_STRCPY(dest, source) do { strncpy(dest, source, sizeof(dest)-1); dest[sizeof(dest)-1] = '\0'; } while(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.
Maybe you can also get rid of this ugly (and unneeded) macro?
src/client.h
Outdated
@@ -27,6 +27,8 @@ | |||
#include <libXBMC_pvr.h> | |||
#include <p8-platform/util/StringUtils.h> | |||
|
|||
using namespace ADDON; | |||
|
|||
typedef std::string String; |
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.
Another ugly piece of code... Something like this is just for the lazy people (or people not knowing "search and replace"... ;-)
Removed the typedef and the macro as suggested. Also saw a comment elsewhere about not using the namespace. So i pulled that change as well. Happy to squash, unless you can do that on merge, just let me know |
555ee0d
to
3f1a124
Compare
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.
Code changes look sane. Thanks. Could you please update changelog and addon version number? Then we're good to go, imo.
rebased and added changelog/version bump. |
squashed and rebased after jsoncpp merge. |
5d4ac31
to
cb100a7
Compare
Couple more minors changed. |
151b63a
to
ec1a4ef
Compare
@ksooo any chance of a final review. Ive repushed all of the changes and split it into individual commits to make it easier to review. The single commit was getting a bit out of hand to keep track of everything i think. I also had a relook and think about the PVR_STRCPY define, and i didnt see it before, but it null terminates whatever is passed to it. In my initial pass of removing that, i wasnt dealing with null termination at all, which obviously is an issue. Should i stick with the define, or is the strcpy + null terminate at each use ok from a readability viewpoint? |
sort headers according to kodi guidelines and include all appropriate headers in each source file
4cac101
to
ffc0b27
Compare
whitespace, aesthetics/layout cleanup Change final for auto range loops, move variable declarations closer to actual usage
Another commit added. Currently a discover is never done past initial startup of addon. This means no additional tuners will ever be added unless the addon is restarted. The change will now add a tuner without a full discover if it is not found in the m_Tuners vector. To handle a tuner disappearing, it will do a clear on the vector if the size is larger than the discovered nTunerCount returned by the discovery request. Figured id throw this and 2 other commits into this PR, as its proven difficult to continue to get PR's merged (this is in no way aimed at you ksooo, because i know you have far more stuff to do than keep looking at one measly addon). |
Hold on! Give me some time to review the PR. I have the feeling if I find no time soon I will be confronted with a 50 commits PR containing all kind of different stuff. ;-) |
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.
lgtm, just some nitpicking from my end. cannot say anything about the correctness of the hdhomerun functioality specific changes, though.
pvr.hdhomerun/addon.xml.in
Outdated
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<addon | |||
id="pvr.hdhomerun" | |||
version="3.1.9" | |||
version="3.1.10" |
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.
If you add new features, please increase minor version number (3.1.9 => 3.2.0 in this case).
pvr.hdhomerun/changelog.txt
Outdated
v3.1.10 | ||
- code cleanup | ||
- guide filters updated | ||
- additional epg_tag fields added |
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.
If you add new features, please increase minor version number (3.1.9 => 3.2.0 in this case).
src/client.cpp
Outdated
|
||
strncpy(signalStatus.strAdapterName, "PVR HDHomeRun Adapter 1", | ||
sizeof(signalStatus.strAdapterName) - 1); | ||
signalStatus.strAdapterName[sizeof(signalStatus.strAdapterName)-1] = '\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.
Could you please add blanks around the -
?
src/client.cpp
Outdated
signalStatus.strAdapterName[sizeof(signalStatus.strAdapterName)-1] = '\0'; | ||
strncpy(signalStatus.strAdapterStatus, "OK", | ||
sizeof(signalStatus.strAdapterStatus) - 1); | ||
signalStatus.strAdapterStatus[sizeof(signalStatus.strAdapterStatus)-1] = '\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.
Could you please add blanks around the -
?
make sure we null terminate our strncpy
change location of variable declarations to avoid construction before a failure case
remove and indent as needed whitespace remove temp variable and return directly in _GetChannelStreamURL()
change to c++ style casts for time_t and last for auto range loop in PvrGetEPGForChannel()
This handles an episode that is numbered via SD's guide to match an episode number such as E2017-199. This sets the series to first number (the year), and episodenumber to the last number.
move guidenumberset outside of tuner loop so it retains the set of channels for all found tuners.
Should test thread creation of updatethread actually succeeds, if not addon should fail as no guide/lineup will be updated.
If a new tuner is found, add it to the list and process as normal If total tuners found is less than the current list, clear and recreate tuner list for all This doesnt not handle the situation of the same tuner count, but different tuners. It will have a greater size on next update call, so should even out in the end, but it will go an hour between the next update call before it is fixed.
Cheers, done. |
win10: fix build on UWP after #69
Further cleanup of existing code. Removing unused variables/functions.
Stub OpenLiveStream and CloseLiveStream as they are not required for implementation as we now rely on GetChannelStreamProperties
Removed some globals that are not used throughout the codebase anymore.
Let me know if ive overstepped anything at this stage. I think this is the final pass for cleanups that i can see at this stage.