ListItem.FileNameAndPath query
#1
Hi,

Couldn't find any threads on this so apologies if they do exist somewhere or this has been discussed before? I think I asked if before but can't remember and couldn't find a thread.

Right, how is ListItem.FileNameAndPath populated and when?

1) Is it available in a list?
2) If not is there any other way to get what I want?

My issue is when in albums, for instance I have \Music\Sigur Ros\Sigur Ros but after using MB Picard etc the album is labelled () in Kodi. But when attempting to obtain cdart.png I build \Music\Artist\Album which gives \Music\Sigur Ros\() which is wrong.

Is it not possible to get the absolute path for the folder in someway? instead of attempting to construct the path and getting possible mismatches like this?

Mike.
SKIN: Aeon Madnox
RIP Schimi2k, we miss you.
When I grow up I want to be a skilled skinner
Thank me by ⬇ adding to my + reputation
Reply
#2
You probably didnt understand the way our music library works. There is no path for an album, album as a "folder" is entirely virtual and only based on id3 tags.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
also asked several times. Should be somewhere in the skinning thread
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#4
Ok thanks.

But if there is no path for an album then why does or how does this code work in DialogAlbumInfo

[code<texture background="true" fallback="special://skin/extras/cdart/default.png">$INFO[ListItem.FileNameAndPath,,/cdart.png]</texture>][/code]

which works as shown here:
Image


Just trying to understand how Listitems, and specifically FileNameAndPath, work in one place but not another?

Mike.
SKIN: Aeon Madnox
RIP Schimi2k, we miss you.
When I grow up I want to be a skilled skinner
Thank me by ⬇ adding to my + reputation
Reply
#5
No one?
SKIN: Aeon Madnox
RIP Schimi2k, we miss you.
When I grow up I want to be a skilled skinner
Thank me by ⬇ adding to my + reputation
Reply
#6
I'm not sure If I understood your problem/question correctly, but I will try to give a bit more info...

The ListItem object provides several info labels for the current selected item in a container/list.
So, in your example it's the New Order album and you can access a lot of info about it via ListItem. (See: http://kodi.wiki/view/InfoLabels#Listitem)

For example:
Code:
ListItem.FileNameAndPath            Shows the full path with filename of the currently selected song or movie in a container


In your case FileNameAndPath delivers the full path to the music files from the selected album. And as the cd art seems to be saved as
{AlbumFolder}/cdart.png, you can access it e.g. by $INFO[ListItem.FileNameAndPath,,/cdart.png] like seen in the DialogAlbumInfo file.
(Btw.: As far as I know, Kodi will use a cached version of the image and recache from given image file only when needed.)

Additionally I have to add that FileNameAndPath is probably working for this case because "the file" of an album is a folder. But e.g. for
single music files and so on, there should be just Path used. (Just keep that one in mind.)

So yes, there is a folder (location) stored for every album in the Kodi DB. Otherwise Kodi wouldn't know where the files to play are located.
But - and it's a big BUT - these folder structures and names are NOT used to build or represent the albums/artists/tracks in your music library.
Instead it's like phil already mentioned all about the ID3 tags: These tags are (or should be!) saved in every single music file and provide all
the metadata. (See: http://id3.org)

That means that if there is something messed up in your music library, you probably got incomplete or wrong ID3 tags. Software like MusicBrainz
organize these metadata tags and may alter some values but normally Picard is a trusted program which works nicely for ID3 tagging. So, I don't
know what exactly is leading to your "()" album name issue. The best thing would be If you could post the ID3 tags of an affected music file.
Reply
#7
Hi josch,

The problem is a relative to physical file naming, everything has gone through the tagging in MB Picard and the Sigur Ros album is an example. the id3 tagging has assigned and album name of '()' but the actual physical folder name is /Sigur Ros.

The problem is I can access cdart like you say here as FileNameandPath has no value when I'm attempting to use it>=:

"In your case FileNameAndPath delivers the full path to the music files from the selected album. And as the cd art seems to be saved as
{AlbumFolder}/cdart.png, you can access it e.g. by $INFO[ListItem.FileNameAndPath,,/cdart.png] like seen in the DialogAlbumInfo file.
(Btw.: As far as I know, Kodi will use a cached version of the image and recache from given image file only when needed.)"

It seems I cannot use Filenameandpath from within a list as outputting the $INFO as a label just shows nothing, due to this it seems in the past the solution has been to build the filename and path from various VAR's which ends up with \Sigur Ros\() as Kodi has via id3 tagging the artist 'Sigur Ros' and the album '()', so this fails to read the cdart.png as the relative and physical folder names are different, same goes for any album that might have say (Deluxe) or [Explicit] in the physical folder name but not in the id3 tags.

So again all I'm trying to understand is why when in DialogAlbumInfo Filenameandpath exists / is populated but when in a list it is empty for exactly the same album?

I guess what would be ideal is that cdart is added to the db like discart for movies and then we have ListItem.Art(cdart), but I've read time and time again no team member is interested in working on the music side of Kodi!? This is a shame, I don't have the skills myself, but won't it come at some point that the music side is completely outdated if there is no one to wokr on it?

And yes I know I could rename the physical folder but why should I? If like you said Kodi knows the folder otherwise it wouldn't know where the files I then why can't I use that location?

Thanks,

Mike
SKIN: Aeon Madnox
RIP Schimi2k, we miss you.
When I grow up I want to be a skilled skinner
Thank me by ⬇ adding to my + reputation
Reply
#8
the fact that it "works" in dialogalbuminfo is a bug. it's not supposed to return any path there.
as explained, kodi does not store album paths in the database.
you can store the tacks of an album across different folders and kodi will figure out which tracks belong to the same album
and represent it as a single album in the interface.

what you see is that it probably takes the path to the first song on the album and uses that in the album info dialog (or something like that).
again, it's a bug.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#9
it probably works because of the container with id "50", containing the tracklist of that album. (Tracks, in contrast to albums, do have a path associated)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#10
Ok, thank you to everyone for the help and feedback. Seems there is no solution or easy solution to it then at the moment which is a shame.
SKIN: Aeon Madnox
RIP Schimi2k, we miss you.
When I grow up I want to be a skilled skinner
Thank me by ⬇ adding to my + reputation
Reply
#11
I wrote a solution for this in my skin helper service which I'm about to share as a Kodi addon. It will provide you with some window props for the artwork. I'll let you know once it's available.
Reply

Logout Mark Read Team Forum Stats Members Help
ListItem.FileNameAndPath query0