Test if a specific artwork file exists?
#1
Is there a way to test if a specific artwork file is found so it can be used to determine whether to make a control is visible or not?

More specifically, I want to test if the cdart.png file is found in a directory containing music so I can choose between which of two different controls I will show. I can specify the path to the artwork with $INFO[Player.FolderPath]cdart.png. And I looked over the list of boolean conditions but can't figure out how to test if the file was actually found or not.

Any ideas how to do this? My apologies if this is a simple question. I am pretty new to Kodi skinning and am still pretty early in the learning curve.

Thanks,
Reply
#2
you can use the fallback option to choose alt texture in case the main one missing...
<texture fallback="default_disc.png">$INFO[Player.FolderPath,,cdart.png]</texture>
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
#3
(2015-07-17, 19:43)tomer953 Wrote: you can use the fallback option to choose alt texture in case the main one missing...
<texture fallback="default_disc.png">$INFO[Player.FolderPath,,cdart.png]</texture>

that won't work, because it wont return an empty path in case the cdart.png is missing.

The artwork support for music is not as good as for video. since cdart.png is not saved in database there is no nice way to check for the existence of that file. (some workaround using control.getlabel() is the only option, but it's not recommended to use that)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#4
(2015-07-17, 19:43)tomer953 Wrote: you can use the fallback option to choose alt texture in case the main one missing...
<texture fallback="default_disc.png">$INFO[Player.FolderPath,,cdart.png]</texture>

Thanks for replying. Unfortunately fallback isn't an option because I'm actually trying to test the condition as I want to choose between showing the artwork as animated or showing a visualization when the artwork doesn't exist.
Reply
#5
(2015-07-17, 19:49)phil65 Wrote:
(2015-07-17, 19:43)tomer953 Wrote: you can use the fallback option to choose alt texture in case the main one missing...
<texture fallback="default_disc.png">$INFO[Player.FolderPath,,cdart.png]</texture>

that won't work, because it wont return an empty path in case the cdart.png is missing.

The artwork support for music is not as good as for video. since cdart.png is not saved in database there is no nice way to check for the existence of that file. (some workaround using control.getlabel() is the only option, but it's not recommended to use that)

Thanks for replying. You seem to have nailed the situation. I'm trying to find out if the file exists as I want to animate it if it does. But if not, I want to show a visualization instead. So unless I can test to see if the file is there, I can't figure out a way to make the choice about which one to make visible.

I had not looked into control.getlabel() yet. Is that not recommended because of performance issues or some other reason?
Reply

Logout Mark Read Team Forum Stats Members Help
Test if a specific artwork file exists?0