(2015-09-03, 20:11)KenV99 Wrote: (2015-09-03, 17:46)ReplayHarry Wrote: Ken: I've been using your addon very successfully for awhile now. It gets kicked off when playback starts and playback ends. When playback ends I pop up a menu that gives me the option to delete the file (TV Show) being viewed.
My TV Show recordings are coming from NextPVR.
Here is the issue, sometimes NextPVR creates this long filename that contains commas. I should mention I am running on Windows 8.1.
So the issue is every-time there is a comma in the filename my python scrip that gets kicked off by your callback2 thinks there is an extra parameter. So in affect the "file" parameter becomes and invalid filename (a file that can't be found as it is really an incomplete filename) and therefore does not execute my python script correctly.
I know when you pass a parameter to a python program you can put quotes ("") around the parameter being sent, which then would allow embedded commas. Could you point me in the right direction in your code so I could add those quotes around the filename?
I am sure this is not an issue for most people, so I would not expect you to make this specific change just for me. But I could modify the code myself if I could find the right spot. I have taken a look at your code and it isn't obvious to me where to make that change.
I'd appreciate any help you might be able to offer.
I assume that you are creating the menu from python script. Are you running that script as direct python script or via the builtin? Could you post a link to the code of the script that you are running (i.e. upload it to github or pastbin)?
I think it is likely that you need to change line 326 from:
Code:
runtimeargs.append('file=' + self.getPlayingFileEx())
to
Code:
runtimeargs.append('file="%s"' % self.getPlayingFileEx())
but without the specifics, it's just a guess.
Yes, a python script. Once I saw your example code, I immediately found what needed to be fixed. I did have to change it to put the double quote before the file= and after the variable name so that the entire parameter was bracketed with double quotes. It works perfectly and thanks again for your help. I added it to title also since that is sometime an issue (although a minor one).
Again, a big thank you![/php]
Here is the modified code I am now using.
[php] def onPlayBackStartedEx(self):
runtimeargs = []
temp_str = ''
if __options__['arg_mediatype']:
runtimeargs.append('type=' + self.playing_type())
if __options__['arg_filename']:
temp_str = self.getPlayingFileEx()
# runtimeargs.append('file=' + self.getPlayingFileEx())
runtimeargs.append('"' + 'file=' + temp_str + '"')
if __options__['arg_title']:
temp_str = self.getTitle()
# runtimeargs.append('title=' + self.getTitle())
runtimeargs.append('"' + 'title=' + temp_str + '"')
if self.isPlayingVideo():
if __options__['arg_aspectratio']:
runtimeargs.append('aspectratio=' + self.getAspectRatio())
if __options__['arg_resolution']:
runtimeargs.append('resolution=' + self.getResoluion())
self.dispatcher.dispatch('onPlaybackStarted', runtimeargs)