How to get song info by URI

Need help with MPD?
Post Reply
gilphilbert
Posts: 3
Joined: May 27th, 2020, 6:03 pm

How to get song info by URI

Post 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...!)
max
Forum team
Posts: 1217
Joined: January 15th, 2013, 3:43 pm

Re: How to get song info by URI

Post 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"
gilphilbert
Posts: 3
Joined: May 27th, 2020, 6:03 pm

Re: How to get song info by URI

Post by gilphilbert »

Thank you!
Last edited by gilphilbert on February 24th, 2021, 5:18 am, edited 1 time in total.
max
Forum team
Posts: 1217
Joined: January 15th, 2013, 3:43 pm

Re: How to get song info by URI

Post 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)
Post Reply