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

[pvr] Enable channel name updates from the client #4412

Merged
merged 2 commits into from May 16, 2014

Conversation

Jalle19
Copy link
Member

@Jalle19 Jalle19 commented Mar 13, 2014

Fixes http://trac.xbmc.org/ticket/14930

This fixes the above mentioned ticket (that channel name changes on the backend aren't ever reflected in XBMC unless the PVR database is reset). Now the name is updated from the client automagically except when it has been changed through the channel manager. If it is later changed to an empty string it will again be updated by the backend the next time XBMC is restarted.

@xhaggi and @opdenkamp please review.

If in the future we find that we need another "isUserSet" column we should consider changing them all into a single bitflag column which indicates what has been changed. For now though I think this is a good enough solution.

@xhaggi
Copy link
Member

xhaggi commented Mar 13, 2014

looks good.

@xhaggi
Copy link
Member

xhaggi commented Mar 13, 2014

@opdenkamp @jmarshallnz we should get this in for Gotham

@opdenkamp
Copy link
Member

aren't we in the "crash&burn only" phase already?

@Jalle19
Copy link
Member Author

Jalle19 commented Mar 13, 2014

It's pretty annoying to have to reset the database every time you rename a channel, though I understand if you don't want this for Gotham. It's a pretty isolated change though.

@t-nelson
Copy link
Contributor

aren't we in the "crash&burn only" phase already?

Yes

@jmarshallnz jmarshallnz added this to the H* 14.0-alpha1 milestone Mar 13, 2014
@jmarshallnz
Copy link
Contributor

Deferred to G+1

@xhaggi
Copy link
Member

xhaggi commented Mar 14, 2014

too bad ;)

@da-anda
Copy link
Member

da-anda commented Mar 14, 2014

how often do you guys rename your TV channels so that you consider this fix as important? There are far more "important" issues to fix in PVR :)

@Jalle19
Copy link
Member Author

Jalle19 commented Mar 14, 2014

I don't, it's the providers that do.

@xhaggi
Copy link
Member

xhaggi commented Mar 14, 2014

yes and nobody knows that your name changes in your tv backend aren't reflected to xbmc.

for example on christmas time sky cinema hd is sky christmas hd, but i hope until next christmas we have merged this ;)

@jmarshallnz
Copy link
Contributor

@Jalle19 rebase it up and we'll look at getting this in.

@xhaggi any comment regarding a bitfield rather than separate column now that it's not so urgent?

@xhaggi
Copy link
Member

xhaggi commented May 4, 2014

@jmarshallnz it's fine with a separate column, as we don't have much more info which could be updated in xbmc.

@Jalle19 do not forget to check my comment.

@Jalle19
Copy link
Member Author

Jalle19 commented May 7, 2014

@xhaggi rebased and added the last commit

@xhaggi
Copy link
Member

xhaggi commented May 7, 2014

@jmarshallnz or @opdenkamp should we squash all into one commit?

@Jalle19
Copy link
Member Author

Jalle19 commented May 7, 2014

@xhaggi fixed

@jmarshallnz
Copy link
Contributor

I don't have a preference, but it seems the first commit is separate, and the last 5 could be combined into 1 if you wanted.

@opdenkamp
Copy link
Member

yeah combining those in two commits would be nice

@Jalle19
Copy link
Member Author

Jalle19 commented May 8, 2014

Okay, I'll squash the last four commits into one. Just need to figure out a good commit message.

@xhaggi
Copy link
Member

xhaggi commented May 8, 2014

use [pvr] enable channel name updates from the client as you've done in the title of the PR ;)

@xhaggi
Copy link
Member

xhaggi commented May 9, 2014

could someone trigger jenkins .. i've lost my magic.

@jmarshallnz
Copy link
Contributor

jenkins build this please

@xhaggi
Copy link
Member

xhaggi commented May 10, 2014

@Jalle19 needs a rebase please .. rebabe .. i'm on my tablet :)

@adamsutton
Copy link
Contributor

@Jalle19 is there not a simpler solution to this...

Why not change the PVRChannel usage so that the PVR clients NEVER set the main name, they only ever set the client one. I believe that's a few lines change in the constructor (could be wrong).

Then change the ChannelName() access routine to return m_strChannelName if not empty, else return the client name.

This is actually how channel names work in TVH, if user sets a channel name, use that, if not use the underlying service name.

Much less changes than you have here to achieve almost the same thing. The only diff, could be seen as advantage or disadvantage depending on your take, is that if the user sets the channel name to "", then it will revert to the client version.

@Jalle19
Copy link
Member Author

Jalle19 commented May 12, 2014

What do you other guys think? We'd need another string column for the client name, but I agree that the logic would a bit simpler.

@opdenkamp
Copy link
Member

haven't had time to review the PR yet, but quick comment here while waiting for an upload to finish: won't work, because the client may be offline.

@xhaggi
Copy link
Member

xhaggi commented May 12, 2014

this only makes sense if m_strChannelName remains empty, but we store and load the channel name from our database and put it in m_strChannelName. so we need to identify if the channel name was changed by the user or we have to change the whole database logic and do not store the channel name.

@adamsutton
Copy link
Contributor

@Jalle19 personally I wouldn't bother, if you can, just persist the user defined name to the database. If the client is offline, who cares what the channel name is, it won't be useful anyway.

@opdenkamp
Copy link
Member

the UI does care. we need to store the name in our local db

@Jalle19
Copy link
Member Author

Jalle19 commented May 12, 2014

@opdenkamp if the client is offline the whole channel will be removed anyway.

@adamsutton
Copy link
Contributor

But really I'm not that bothered what the solution is, but I never set channel names in XBMC, so its crazy that if my channels change name (ro something odd happens) that the only way to get things updated is to a) manually change all the channel names to match or b) reset the DB (i.e. the normal solution to this problem)

@opdenkamp
Copy link
Member

no it won't. and i'm going to continue with my work now and review and comment on it later :)

@xhaggi
Copy link
Member

xhaggi commented May 12, 2014

@adamsutton with this PR you get channel updates.

@adamsutton
Copy link
Contributor

@opdenkamp sounds like another issue then, what's the logic behind keeping channels when the client is off line? (Power saving backends?)

@xhaggi sure, I completely get that, but just seemed like an overly complicated approach, I'm happy with either as long as it solves the problem. @Jalle19 and I were discussing this as I noted it while looking at something else and he asked me to put a comment on here so he didn't forget.

Job done.

@opdenkamp
Copy link
Member

e.g. no wifi connection

@adamsutton
Copy link
Contributor

@opdenkamp that's surely not the same? A transient failure is a different issue.

@adamsutton
Copy link
Contributor

A transient failure will not cause all channels to be removed, unless there is something very wrong in the addon? The data should be persisted internally until a reconnection is made, no?

@xhaggi
Copy link
Member

xhaggi commented May 12, 2014

another possible solution would be storing the client channel name too and leave the channel name empty except the user change it. this way we could do it like @adamsutton proposed.

@Jalle19
Copy link
Member Author

Jalle19 commented May 12, 2014

@xhaggi I think that's what he meant from the beginning.

@adamsutton
Copy link
Contributor

@xhaggi @Jalle19 that's exactly what I meant, I just wasn't aware of the issue regarding what is/isn't saved to the DB. Personally I wouldn't bother saving client names, if the client is off-line, it can't be used. But I don't pretend to understand the fully ramifications of such a decision and defer that to those that do.

@xhaggi
Copy link
Member

xhaggi commented May 12, 2014

for internal purposes, i'd prefer to store the name of the underlying client channel. in that way we do it now or in that way @adamsutton proposed.

@Jalle19
Copy link
Member Author

Jalle19 commented May 15, 2014

@xhaggi rebased, had to bump the database version to 24. I'm fine with the current solution for now, no point in reworking it already.

@xhaggi
Copy link
Member

xhaggi commented May 15, 2014

thanks @Jalle19

jenkins build this please

@MartijnKaijser
Copy link
Member

jenkins build this please (he screwed up)

xhaggi added a commit that referenced this pull request May 16, 2014
[pvr] Enable channel name updates from the client
@xhaggi xhaggi merged commit d67a29d into xbmc:master May 16, 2014
@MartijnKaijser MartijnKaijser modified the milestones: Gotham13.0-rc1, Helix 14.0-alpha1 May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PVR Type: Fix non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants