Page 1 of 1

How to get song info by URI

Posted: February 23rd, 2021, 9:21 pm
by gilphilbert
This may seem like a basic question, but how do you get the information for a song when you have it's URI in the database?

I've tried "find" and "search" but neither seem to give a response. For example, let's look up a random song, so we know it exists in the database. This also gives us the URI.

Code: Select all

search "(title == 'Just Another Poor Boy')"
file: music-lossless/Chris De Burgh/Spanish Train and Other Stories/10. Just Another Poor Boy - Chris de Burgh.flac
Last-Modified: 2020-06-12T18:40:18Z
Format: 44100:16:2
Title: Just Another Poor Boy
Artist: Chris de Burgh
Album: Spanish Train And Other Stories
Genre: Pop
AlbumArtist: Chris De Burgh
Disc: 1
Date: 1975
Track: 10
Time: 282
duration: 282.066
OK
So we know the file exists in the database and the URI is

Code: Select all

music-lossless/Chris De Burgh/Spanish Train and Other Stories/10. Just Another Poor Boy - Chris de Burgh.flac
Now, let's say I've only got the URI and I need to get that same list of info from above:

Code: Select all

search "(file == 'music-lossless/Chris De Burgh/Spanish Train and Other Stories/10. Just Another Poor Boy - Chris de Burgh.flac')"
OK
No results back from search/find. How do I lookup a file given only the URI? Perhaps I've missed something in the documentation (that I've read several hundred times...!)

Re: How to get song info by URI

Posted: February 23rd, 2021, 11:12 pm
by max
Just use "lsinfo".

Code: Select all

lsinfo "music-lossless/Chris De Burgh/Spanish Train and Other Stories/10. Just Another Poor Boy - Chris de Burgh.flac"

Re: How to get song info by URI

Posted: February 24th, 2021, 5:03 am
by gilphilbert
Thank you!

Re: How to get song info by URI

Posted: February 24th, 2021, 5:17 am
by max
This is not a MPD response. I have no idea what it is, but apparently, you're not using MPD.
Other than that, read and obey https://www.musicpd.org/help/ (a requirement which you chose to ignore on IRC)