Help on JSON RPC Files.Download
#16
thanks for that... when i asked the frodo api description page was down....
Reply
#17
i'm sorry to hit you again, but how do i retrieve the file path and file name of a given song from the songid or song title... i'm not seeing anything in api that would give me access to the external file path so i can subsequently prepare for download...
Reply
#18
AudioLibrary.GetSongDetails returns properties of a specific song based on its ID. You can request the "file" property to get the path and filename of that song.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#19
(2013-07-22, 07:56)Montellese Wrote: AudioLibrary.GetSongDetails returns properties of a specific song based on its ID. You can request the "file" property to get the path and filename of that song.

i tried that:

i tried it with this request, {"jsonrpc":"2.0", "method":"AudioLibrary.GetSongDetails", "params":{"songid":1,"properties":["file"]},"id"=1}

the request only returns the songid and label (i also tried "id":"LibSongs")...

perhaps i made a mistake in my request, but it goes through and gets a return without error messages...

the return is exactly {"id":1,"jsonrpc":"2.0","result":{"songdetails":{"label":"What's Up?","songid":1}}}

when i try the same request with artis in place of file the artist is returned....

as is i'm left with building a file system through GetDirectory... seriously cumbersome for downloading a song that i've already located....
Reply
#20
Try the "path" property instead.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#21
{"jsonrpc":"2.0", "method":"AudioLibrary.GetSongDetails", "params":{"songid":1,"properties":["path"]},"id"=1}
returns invalad params...

file returns but the file name isn't there...
it seems like the only way to get to find a file path is to know it already...

from the api:
Audio.Details.Songs
properties:
[ string lyrics = "" ]
Library.Id songid
[ Array.Integer albumartistid ]
[ integer disc = 0 ]
[ string comment = "" ]
[ integer playcount = 0 ]
[ string album = "" ]
[ string file = "" ]
[ string lastplayed = "" ]
[ Library.Id albumid = -1 ]
[ string musicbrainzartistid = "" ]
[ Array.String albumartist ]
[ integer duration = 0 ]
[ string musicbrainztrackid = "" ]
[ integer track = 0 ]

path isn't there...
file is there but doesn't return a filename, much less a path...

if i were much better at this i would try and edit whatever i could to give myself access to the file name and path, but i've been programming about a month... i thought i was doing good to get this far in a short time...
Reply
#22
"file" should be working for AudioLibrary.GetSongs (with v6 API).

You could try this utility which will query your songs, and log the queries, eg:

Code:
./texturecache.py jd songs home\ computer @logfile=/tmp/tc.log @logfile.verbose=yes

returns:
Code:
[
  {
    "album": "Computer World",
    "songid": 1629,
    "artist": [
      "Kraftwerk"
    ],
    "fanart": "image://http://assets.fanart.tv/fanart/music/5700dcd4-c139-4f31-aa3e-6382b9af9032/artistbackground/kraftwerk-4ddab726597a1.jpg/",
    "title": "Home Computer",
    "label": "Home Computer",
    "file": "nfs://192.168.0.3/mnt/share/data/Music/MP3/Kraftwerk/Kraftwerk - 1981 - Computer World/06 - Homecomputer.mp3",
    "thumbnail": "image://nfs://192.168.0.3/mnt/share/data/Music/MP3/Kraftwerk/Kraftwerk - 1981 - Computer World/cover.jpg/"
  }
]

and in the log file, /tmp/tc.log:
Code:
...
2013-07-22 13:29:44.279685:MainThread: libSongs.JSON SOCKET REQUEST: [{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "title", "value": "ho
me computer"}, "properties": ["title", "artist", "album", "fanart", "thumbnail", "file"]}, "method": "AudioLibrary.GetSongs", "id": "libSongs"}]
2013-07-22 13:29:44.700641:MainThread: libSongs.BUFFER RECEIVED (len 630)
2013-07-22 13:29:44.700693:MainThread: libSongs.PARSING JSON DATA: {"id":"libSongs","jsonrpc":"2.0","result":{"limits":{"end":1,"start":0,"total":1},"songs":[{"album":"Computer World","artist":["Kraftwerk"],"fanart":
"image://http%3a%2f%2fassets.fanart.tv%2ffanart%2fmusic%2f5700dcd4-c139-4f31-aa3e-6382b9af9032%2fartistbackground%2fkraftwerk-4ddab726597a1.jpg/","file":"nfs://192.168.0.3/mnt/share/data/Music/MP3/Kraftwerk/Kraftwerk
- 1981 - Computer World/06 - Homecomputer.mp3","label":"Home Computer","songid":1629,"thumbnail":"image://nfs%3a%2f%2f192.168.0.3%2fmnt%2fshare%2fdata%2fMusic%2fMP3%2fKraftwerk%2fKraftwerk%20-%201981%20-%20Computer%
20World%2fcover.jpg/","title":"Home Computer"}]}}
2013-07-22 13:29:44.700751:MainThread: libSongs.PARSING COMPLETE, elapsed time: 0.000033 seconds
2013-07-22 13:29:44.700780:MainThread: libSongs.RECEIVED LIMITS: {u'start': 0, u'total': 1, u'end': 1}
2013-07-22 13:29:44.700800:MainThread: libSongs.FINISHED, elapsed time: 0.421074 seconds

If you don't get a valid "file" for your songs, there's something wrong with your library...
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#23
i'm afraid that i am not running a linux box and currently have no idea how to run "Python 2.7.3... ...against a remote Frodo installation of XBMC..." so running that code is at the very least a daunting task...

however at the suggestion that there may be file corruption in the database i did remove the source, scrap all library entries, add the source again, then scan to the library... as it seems that what the author of the script was saying was it's a pain in the posterior to do that, so he wrote the script: "It's annoying having to delete the entire Textures13.db+Thumbnails folder to try and correct scraping errors and/or corrupted images that just never go away"...

same result, the songid and label are returned but the file path is not...

i also checked the result of a "properties":["file"] on movie and tvshow GetDetails queries... both returned the complete file path with no difficulty...

i'm running windows vista, have frodo installed, and have no other issues whatsoever with using the jsonrpc...

but when i request the file path i never get a file path... i have tested repeatedly for approximately 50 random song ids of the approximately 8000 listed in my library...

i simply have no idea what else to do....

are there settings that i could check?
is it possible that there is a bug?Huh
can you suggest a workaround that doesn't require creating a file browser to search for a song that i have already found?
Reply
#24
i just checked my jsonrpc permissions all 13 return as true
Reply
#25
(2013-07-22, 20:29)sraisbeck Wrote: i'm afraid that i am not running a linux box and currently have no idea how to run "Python 2.7.3... ...against a remote Frodo installation of XBMC..." so running that code is at the very least a daunting task...

You just need to install Python (eg. Python 2.7.3, or Python 3.3), then run the script eg. "c:\Python27\python.exe c:\texturecache.py <args>". Since you're trying to test Python code, I kind of assumed you already had Python installed.

Obviously you don't have to get the script working, I just though it might be useful to you as it's known to work, and you can very clearly see the queries being generated with each response, plus you can specify additional fields to be retrieved quite easily.

It still sounds like your db is corrupted in some way - assuming you are not using MySQL, maybe you can upload your MyMusic32.db somewhere so that someone else can check it over?
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#26
okay, i installed python (i've been using sl4a, from my phone for remote queries) attempted to run the script and ran into a ton of errors which will take me a week to sort through and figure out how to make run properly, but that is another can of worms and one for me to sort out on my own...

i went looking for the database file you referred to... it's supposed to be in c:\program files (x86)\xbmc\userdata... there are two folders and 6 files there, none of them being MyMusic32.db...

so i performed a search of my entire computer, that file doesn't exist... but then again neither does MyMovies and yet i get a response from xbmc when i search using json for the file property...

what i do have is the exported databases for video and music in xml format...

under the video xml every movie has a clear entry to the effect of: <filenameandpath>H:\movies\127.Hours.2010.DVDSCR.AC3.XViD-T0XiC-iNK.avi</filenameandpath>
and a quick check using the jsonrpc api shows that is exactly what is returned from a getmoviedetails query with the property "file"

but under the music xml there is no entry for <filenamandpath>...
there does exist an entry for the path (i.e. <path>H:\music\4 non-blonds\</path>), and would still leave me guessing as to what the file name is, leaving me to use GetDirectory to list the files in the path and manually pick the file for the individual song... if i could use the "path" property with GetSongDetails, which we have already established cannot be done...

i think what has happened is that the property has been included in the jsonrpc api, but it is not being logged in the database when i scan the source...

i made no changes to the code of xbmc that would result in such an error... we have already established that at this point in my programming career i'm not capable of that without breaking xbmc...

i think there is a bug
Reply
#27
got the script working... can't locate the files... they aren't there to locate
Reply
#28
located the MyMusic32.db file under appdata, deleted rescanned... same problem

assuming there is database corruption...

what do i do?
Reply
#29
(2013-07-23, 12:06)sraisbeck Wrote: got the script working... can't locate the files... they aren't there to locate

What does this mean, are you saying the script returns the same results ie. no file in the JSON response? What is in the log file (upload a sample log to pastebin.com).
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#30
it means the script can't locate the files required to perform the functions asked of it... without a tutorial on altering the configuration file i'm afraid that is about all i can give you...


have you tried using the jsonrpc api to return the property "file" from a call to the AudioLibrary.GetSongDetails API?

have you been able to return a file path and file name?

the xml files for video and music of my libraries are clearly different, the video file has a listing for <filenameandpath> while the music xml does not... both contain <path> but this is not a property returnable from the jsonrpc api for audio as can be seen in the above posting...

i have tried multiple deletions and rescannings...

i can see no method by which to alter default settings and also scan the file name and path into the library...
Reply

Logout Mark Read Team Forum Stats Members Help
Help on JSON RPC Files.Download0