removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
(2014-10-22, 07:48)marcelveldt Wrote: One more small question of some behaviour I just spotted while investigating a users problem...
If you change the label of a shortcut the thumb/icon gets reset. Is that a problem or by design ?
Also I noticed that the labelID property gets set by the new name, while the icon assignments (overrides) check the labelID and not the defaultID (which stays the same).
So for example if you have a Movies tile with a movies thumb assigned to it and you change it name to Films, you loose the thumb.
It's both a problem and by design - it's a limitation of the labelID system thats used and icon overrides. When the labelID changes (which it does when you change the label) the icon override no longer applies, so the icon is lost.
What I find works a lot more consistently is overriding the icon based on the image, not the labelID - so something like (the completely untested) ...
Code:
<shortcut label="$INFO[Window(Home).Property(titanmb3.0.title)]" grouping="32029" type="1037" icon="mediabrowser1.png" condition="!IsEmpty(Window(Home).Property(titanmb3.0.path))">$INFO[Window(Home).Property(titanmb3.0.path)]</shortcut>
... for your available shortcut (note, the icon has to exist though it can be holding image), and for the icon override ...
Code:
<icon image="mediabrowser1.png">$VAR[Custom0Thumb]</icon>
... should give closer to the expected behaviour. (That's assuming that you can't set the icon straight to the $VAR...?)
It's one of those things that will get improved dramatically if I ever come up with something better than the labelID/defaultID system.
Posts: 8,283
Joined: Jul 2014
2014-10-22, 10:58
(This post was last modified: 2014-10-22, 11:20 by User 224999.)
Tried your suggestion and it doesn't work, if you change the label the icon gets reset to DefaultShortCut.png...
No worries, I'll just hide the "change label" button for now and present it only at submenu level (as that doesn't use icons).
Oh, about setting the icon straight to the $VAR[]... Yes that's how I'd prefer it but than there's no image shown in the selectdialog.
The image works fine in the mainmenu however.
So for now I just use that placeholder image mediabrowser.png and later set the correct $VAR based on the labelID.
Offcourse if the correct image is shown right away that would be even better. The variable also contains the fallback-image if the window-properties are not (yet) filled. Maybe this is the same issue as with the labels ?
Thanks again for your time
EDIT: setting the $VAR as icon right away without the overrides is not working at all... I thought this was working but the icon overrides where still there :-)
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Strange, the label should have no effect on the icon with this method (unless another override is acting on the item), and the icon should only get reset to DefaultShortcut.png if Kodi reports the image doesn't exist
It's fundamentally the same issue but, due to differences in how labels and icons are handled, it would require a fair few changes to fix. I'll add it to the to-do list.
Posts: 8,283
Joined: Jul 2014
(2014-10-22, 11:51)Unfledged Wrote: Strange, the label should have no effect on the icon with this method (unless another override is acting on the item), and the icon should only get reset to DefaultShortcut.png if Kodi reports the image doesn't exist
It's fundamentally the same issue but, due to differences in how labels and icons are handled, it would require a fair few changes to fix. I'll add it to the to-do list.
Don't hurry as it is working now with the workaround.
Maybe you could only take a look at the listitem.icon for the dialogselect? That is also retrieves the window property ?
If that's a lot of work than never mind, users will see the fallback image in the select dialog.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Don't worry, I won't be hurrying
(update to the script on the repo has been submitted, and I always only do critical fixes for a fair few days after submitting an update
)
When I do fix it, though, I'll do my best to fix $INFO's/$VAR's wherever they could be used
Posts: 8,283
Joined: Jul 2014
(2014-10-22, 11:57)Unfledged Wrote: Don't worry, I won't be hurrying (update to the script on the repo has been submitted, and I always only do critical fixes for a fair few days after submitting an update)
When I do fix it, though, I'll do my best to fix $INFO's/$VAR's wherever they could be used
Great! Thanks!
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Thanks to very quick work by Martijn, version 0.4.2 is now on the repo.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Once I get back to properly coding on this, I'll certainly look into it. (It won't work if you're using this method to keep playlists on a networked path, though - which is a limitation of the python methods used to list the contents of the playlist directory
)
Posts: 635
Joined: Nov 2012
Reputation:
15
phate89
Team-Kodi Member
Posts: 635
Are you talking about "Files.GetDirectory"? I tried and ou're right. Is it a bug or it's supposed to fail? Because kodi internally handles it well. Content loading is perfect if i manually set the playlist.
Anyway thanks as usual.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Actually for playlists I use Pythons os.walk(). I've had Files.GetDirectory in my mind as a potential future alternative (with the big negative of having to manually implement path walking), but if that doesn't work for network paths, I won't bother!
Posts: 635
Joined: Nov 2012
Reputation:
15
phate89
Team-Kodi Member
Posts: 635
Erase what i said it works with Files.GetDirectory. But it works with source and kodi paths that kodi can recognize i think. For example i have smb://SERVER/Videos/Movies in a source. If i try smb://SERVER/ or smb://SERVER/Videos/ it wont work but smb://SERVER/Videos/Movies/ it does.
It also works with remote userdata folders like my playlist one:
smb://SERVER/Users/root/AppData/Roaming/XBMC/userdata/playlists/video/
I think that with Files.GetDirectory it would work well so maybe you should wait to add until it fully works...
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Good investigative skills
I'll add it to my to-do list.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Nice
it'll be a few days before I can look at making these changes. Whilst you're looking into Files.GetDirectory(), I'd be happy to provide advice for modifying the script...