Kodi Community Forum

Full Version: Recently Added Songs (Singles) -> service.library.data.provider?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Looking since years for a Way to show recently Added Songs.

Couse i'm nearly Sick of wayting thil XBMC FINALY! Add "Sort by: Date (FileDate)" in the Music section (Singles) i decide to find a Way
via Skinning.

As in "Aeon MQ5" showd, its possible to show "recently Added Songs (Singles)" -> (LatestSong)
but if you want a long list with lets say the Last 50 Added (Single)-Songs there is a lot!! of coding / coding efford needed.

To cut a Long story short:

Could some one ( @BigNoid: ) Add "last (Single)-Songs" to the "service.library.data.provider"-Script? Please. (this would make things much easyer)

Sadly i didnt find a Tread for the "service.library.data.provider"-Script, so i have to go that way to Post my Question.
(if there is a Tread for the "service.library.data.provider"-Script just guide me there and i will ask directly there for this feature!)

-
Still hope "Sort by: Date (File Date)" will be available in the Music Section in Helix, but thil then I need another way to let XBMC show me the last Added (Single)-Songs.
So i hope my wish is heard, and there will be a method included to achief this in the "service.library.data.provider"-Script.

removed151214

https://github.com/unfledged/service.lib...cent-Songs - adds type=recentsongs.

That's based on PR 16 (which adds recentvideos). If that doesn't get accepted this would have to be rebased before I'd submit a PR.

Three problems with it - firstly, library data provider doesn't return much info for songs, not even track number. Second, there's no guarantee this would be accepted - I know BigNoid always considers speed impact before accepting any PRs and, as this has to do an extra JSON query, it does impact (albeit only slightly) on speed. Finally, it needs testing first Smile Oh, and 4, it doesn't check for singles - it returns all recently added songs. Probably possible to add, but I haven't now got the time to do any more playing this weekend.
Hello and Thanks for your Effort!

(2014-07-05, 16:11)Unfledged Wrote: [ -> ]Three problems with it - firstly, library data provider doesn't return much info for songs, not even track number.
I don't care much on Tracnumbers in the "Single" Section, cause there imho. arn't realy needed there.

(2014-07-05, 16:11)Unfledged Wrote: [ -> ]Second, there's no guarantee this would be accepted - I know BigNoid always considers speed impact before accepting any PRs and, as this has to do an extra JSON query, it does impact (albeit only slightly) on speed. Finally, it needs testing first Smile
So Hope it gets a Go. Image

(2014-07-05, 16:11)Unfledged Wrote: [ -> ]Oh, and 4, it doesn't check for singles - it returns all recently added songs. Probably possible to add, but I haven't now got the time to do any more playing this weekend.
Thats no Problem i can thake the whole "Single"-Section as a Source. (Just have to figuere out, where i have to place the "&Limit=foo" -thing.

Regards.
Just add it to the end -

Code:
<content target="video">plugin://service.library.data.provider?type=recentmovies&amp;reload=$INFO[Window.Property(recentmovies)]&amp;limit=12</content>

removed151214

(Am I the first person to get a double post on these forums? Either way, see the next post.)

removed151214

You can't use the scripts limit property to limit the results to singles only, if that's what you're thinking - that property just limits the amount of results returned. It needs to be done by the filter property of the relevant function in library.py (preumably filtering by their being no album property? I don't use XBMC for music myself, so advice on this is welcome.)

That will also need linking to a script setting to only return singles. Presumably, this setting will be disabled by default - so all recent songs will be returned unless the user chooses otherwise. I'd be interested in the general opinion of skinners, though, as to whether that should be the default or not.

(And to be clear, I won't be able to work on this now until the weekend at the earliest, which doesn't mean someone else won't be able to.)
(2014-07-08, 02:00)Unfledged Wrote: [ -> ]You can't use the scripts limit property to limit the results to singles only, if that's what you're thinking
No not!, did thought could use this to limit the results.

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]that property just limits the amount of results returned.
which is what i would use it for and what i would need (if i could Guide the script to "Singles".)

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]I don't use XBMC for music myself, so advice on this is welcome.)

That will also need linking to a script setting to only return singles.
Did thouth i could use the Path to Singles in the Script somehow "(MusicLibrary,Singles,return)" or "musicdb://singles" (at least as much as i understand the behavior)

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]so all recent songs will be returned unless the user chooses otherwise.
just use the Path to singles should do it i guess, and then limit it via Limit="foo" (thanks Hitcher!)

as much as i understand you, i have to use "recentmovies" to achive "recentsongs"? right?

PHP Code:
<content target="music">plugin://service.library.data.provider?type=recentmovies&amp;reload=$INFO[MusicLibrary,Singles,return]&amp;limit=12</content> 

or: (to open the Content in the Library)

PHP Code:
ActivateWindow(MusicLibrary,Singles,plugin://service.library.data.provider?type=randommovies,return)&amp;limit=12 

or:

PHP Code:
ActivateWindow(10500,musicdb://singles,plugin://service.library.data.provider?type=randommovies,return)&amp;limit=12 

or do i get something wrong?

Did just try the second example (Activate.Window) but no luck, no mather if i try to limit the result. Seems i do a Mistake somwhere..??

removed151214

(2014-07-14, 22:54)Rantanplan-1 Wrote: [ -> ]
(2014-07-08, 02:00)Unfledged Wrote: [ -> ]You can't use the scripts limit property to limit the results to singles only, if that's what you're thinking
No not!, did thought could use this to limit the results.

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]that property just limits the amount of results returned.
which is what i would use it for and what i would need (if i could Guide the script to "Singles".)

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]I don't use XBMC for music myself, so advice on this is welcome.)

That will also need linking to a script setting to only return singles.
Did thouth i could use the Path to Singles in the Script "(MusicLibrary, Singles, return)" (at least as much as i understand the behavior)

(2014-07-08, 02:00)Unfledged Wrote: [ -> ]so all recent songs will be returned unless the user chooses otherwise.
just use the Path to singles should do it i guess, and then limit it via Limit="foo" (thanks Hitcher!)

as much as i understand you, i have to use "recentmovies" to achive "recentsongs"? right?

PHP Code:
<content target="music">plugin://service.library.data.provider?type=recentmovies&amp;reload=$INFO[MusicLibrary,Singles,return]&amp;limit=12</content> 

or: (to open the Content in the Library)

PHP Code:
ActivateWindow(MusicLibrary,Singles,plugin://service.library.data.provider?type=randommovies,return)&amp;limit=12 

or:

PHP Code:
ActivateWindow(10500,musicdb://singles,plugin://service.library.data.provider?type=randommovies,return)&amp;limit=12 

or do i get something wrong?

Did just try the second example (Activate.Window) but no luck, no mather if i try to limit the result. Seems i do a Mistake somwhere..??

The library data provider script doesn't work like that. At all. I'll hopefully have some time to work on it in the next couple of days. After I have, I'll let you know how you'll need to call it to get the recent singles.
(2014-07-14, 23:20)Unfledged Wrote: [ -> ]The library data provider script doesn't work like that. At all. I'll hopefully have some time to work on it in the next couple of days. After I have, I'll let you know how you'll need to call it to get the recent singles.

Thanks!! Gr8! Would be pretty cool if you could get this to work!

I will have a look from Time to Time. Image

Regards.

removed151214

Sorry I haven't had time to get to this sooner (too busy breaking my own scripts Wink). Branch with recent songs/recent singles.

With that branch installed, for a widget:

Code:
<content target="music">plugin://service.library.data.provider?type=recentsongs&amp;reload=$INFO[Window(10000).Property(recentsongs)]</content>

To access a library view:

Code:
ActivateWindow(MusicLibrary,plugin://service.library.data.provider?type=recentsongs,return)

By default it will return all recent songs, not just singles. To return singles only, select "Recent Singles Only" from the services settings. And, for good measure (because the service doesn't automatically reload its data when its options change), restart XBMC.

I don't have any singles in my library so I can't test the singles function, but from what I've read (singles are treated as songs with no album) it should work.

If enough people try it to confirm it works (without significant performance issues) I'll look at a pull request for it to be included in the official.
(2014-07-24, 19:21)Unfledged Wrote: [ -> ]Sorry I haven't had time to get to this sooner (too busy breaking my own scripts Wink).

Easy, Was fast. Not shure if this is smart to tell, but i would have wait longer for such a feature (with ease!). Happy you give it a try!!.


(2014-07-24, 19:21)Unfledged Wrote: [ -> ]I don't have any singles in my library so I can't test the singles function, but from what I've read (singles are treated as songs with no album) it should work.

If enough people try it to confirm it works (without significant performance issues) I'll look at a pull request for it to be included in the official.

yes Songs without Album Tag.

Did give it a try and after some Problems with installation i've get it to run.
Sideinfo: After first try to install it i didnt got the option to select just Singles. Did then bump the Version to 0.0.5, repack it, rename the already existing scriptfolder in "appdata/roaming/xbmc/addons/.. , remove the "Recent-Song" from the .zip-name and install it again. This time it did work!!

did got some problems to get it run propperly.
While first try:, as soon as i select "just show singles" the List was Empty!!, So i remove my Musicsource from xbmc and add everithing new. after this both methods (ActivateWindow and the one for widgets) got content. Big Grin

a problem which i recognise, if i set the limit in the Addon from 20 to lets say 250, everytime i open "recent Singles" it shows me just 20. as soon as i go a Folder deeper (there where i can choose from all the Options of the addon (recent movies, recent videos and so on)), and reopen "recent songs" all 250 show up as set in the addon.

From the Point of the performance, it looks god to me (fast) so O.K.

A other Problem which i recognise was after remove my music-source and re-add it, there seems to be a problem with "recently Added Albums" (they didnt work right now, did Add a new Album to try if the separation of the script work right, but this Album whont show up in the "recently added Albums". It could be that this is a problem of XBMC (seems they,ve got some problems with the musiclibrary since gotham, will install Gotham 13.2 Gotham beta and do some more testing.

Will also try to install the modified script on my Main Machine and see if i've got simular issues there (empty lists).

hope my englisch was good enouth to discripe the issues and what i try to fix them.


So far, Thank you verrrry! much for this!

regards

removed151214

(2014-07-25, 18:58)Rantanplan-1 Wrote: [ -> ]Easy, Was fast. Not shure if this is smart to tell, but i would have wait longer for such a feature (with ease!). Happy you give it a try!!.

Good to know, as I'm spending next week at the beach so won't be fixing anything there Big Grin (assuming I can't get wifi at the beach!)

(2014-07-25, 18:58)Rantanplan-1 Wrote: [ -> ]Did give it a try and after some Problems with installation i've get it to run.
Sideinfo: After first try to install it i didnt got the option to select just Singles. Did then bump the Version to 0.0.5, repack it, rename the already existing scriptfolder in "appdata/roaming/xbmc/addons/.. , remove the "Recent-Song" from the .zip-name and install it again. This time it did work!!

did got some problems to get it run propperly.
While first try:, as soon as i select "just show singles" the List was Empty!!, So i remove my Musicsource from xbmc and add everithing new. after this both methods (ActivateWindow and the one for widgets) got content. Big Grin

It does need a version bump to ease installation. I'll sort that.

Rather than deleting and re-adding, you should just be able to restart XBMC and new settings will take effect - it's a known issue where the data isn't updated after settings are changed.

(2014-07-25, 18:58)Rantanplan-1 Wrote: [ -> ]a problem which i recognise, if i set the limit in the Addon from 20 to lets say 250, everytime i open "recent Singles" it shows me just 20. as soon as i go a Folder deeper (there where i can choose from all the Options of the addon (recent movies, recent videos and so on)), and reopen "recent songs" all 250 show up as set in the addon.

Same issue with data not updating after settings are changed.

(2014-07-25, 18:58)Rantanplan-1 Wrote: [ -> ]A other Problem which i recognise was after remove my music-source and re-add it, there seems to be a problem with "recently Added Albums" (they didnt work right now, did Add a new Album to try if the separation of the script work right, but this Album whont show up in the "recently added Albums". It could be that this is a problem of XBMC (seems they,ve got some problems with the musiclibrary since gotham, will install Gotham 13.2 Gotham beta and do some more testing.

I haven't changed the album code at all, so any issues there would be separate from the recent songs/singles.
Empty Lists

After deleting the MusicDB to solve the Album issues i've got allways empty Lists (no mather how often i restart XBMC or the Whole PC)

To finde out what causes the Problem with the recently Added Albums i delete the MusicDB (userdata) and re-add everithing to the new DB. The Problem with recently Added Albums seems not to be a real Problem, some testing make me think that Recently Added Albums arn't listed according to Filedate (like in the Videolibrary), it seems them listed according to the time and date them are added to the library. (not verry Accurate and kinde of confusing imho, but thats an other Topic.)

to cut the storry short:

after rebuild the Musicdb and re-add the files, i've got allways emty lists (no mather how often i restart XBMC (or the whole PC)) (with disabled option to show only Singels the list got content)


(2014-07-25, 20:20)Unfledged Wrote: [ -> ]
(2014-07-25, 18:58)Rantanplan-1 Wrote: [ -> ]Easy, Was fast. Not shure if this is smart to tell, but i would have wait longer for such a feature (with ease!). Happy you give it a try!!.

Good to know, as I'm spending next week at the beach so won't be fixing anything there Big Grin (assuming I can't get wifi at the beach!)
so it seems i was lucky you finde time before your "Beach bracke"Wink

removed151214

What shows next to Album in the song information dialog for a single you expect to see in the list? ('i' on a keyboard to display it)

Edit - and what album scraper do you use? From a quick test, with the "Universal Album Scraper" (and songs tagged as singles with MusicBrainz Picard), the album is set to [non-album tracks] which won't show up in the singles list (because they have an album set). With the "Local information only" scraper, and a track wih its album tag removed, the list is working correctly for me.
(2014-07-26, 15:47)Unfledged Wrote: [ -> ]What shows next to Album in the song information dialog for a single you expect to see in the list? ('i' on a keyboard to display it)
Image

(2014-07-26, 15:47)Unfledged Wrote: [ -> ]Edit - and what album scraper do you use? From a quick test, with the "Universal Album Scraper" (and songs tagged as singles with MusicBrainz Picard), the album is set to [non-album tracks] which won't show up in the singles list (because they have an album set). With the "Local information only" scraper, and a track wih its album tag removed, the list is working correctly for me.
i'm using also the "Universal Album Scraper". I tagg my Musicfiles with iTunes or mp3Tag.



EDIT:

A quick look in the Settings Area told me that "download additional information during updates" was disabled while reimport the music, should i have enabled this option to so solve the behavier?
Pages: 1 2