IPB

Welcome Guest ( Log In | Register )

17 Pages V  « < 13 14 15 16 17 >  
Reply to this topicStart new topic
foo_softplaylists, Aggregated playlists from last.fm's loved track feature
gaurav
post Mar 14 2011, 12:32
Post #351





Group: Members
Posts: 16
Joined: 21-February 10
From: India
Member No.: 78361



Cheers for the great plugin Johan!
I signed up at last.fm just yesterday, and started using your plugin in combination with MonoLite Plus 0.4.3
The softplaylists plugin provided with the skin (dated 2009) was buggy for two reasons:
1. It took a very long time to load when starting Foobar
2. When going to Library->Configure->Tools->Soft Playlists, it took a long time to display that page and to save any alterations.

So I updated the softplaylists to the latest 2011 build. The first issue was gone. The second issue was partly gone, it still takes time to save any changes in soft playlists settings. Moreover, the Love button with the skin no longer is able to Love the tracks, it seems there is some handshake issue with the new version?
The code for the Love button is:
CODE
// ==PREPROCESSOR==
// @import "%fb2k_path%skin\mono_lite\scripts\common.js"
// @import "%fb2k_path%skin\mono_lite\scripts\tooltip_buttons.js"
// @import "%fb2k_path%monolite_lastfm_config.js"
// ==/PREPROCESSOR==

var bw = 24;
var bh = 20;
var top_margin = 0;
var left_margin = 0;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var panel_id = window.GetProperty("panel_id", window.id);
var custom_background_file = settings_path + panel_id + "custom_background";
var custom_background = read(custom_background_file);
var username_file = settings_path + "username";
var username = read(username_file);
var api_key_file = settings_path + "api_key";
var api_key = read(api_key_file);

on_item_focus_change();

function on_notify_data(name, data) {
username = read(username_file);
api_key = read(api_key_file);
on_metadb_changed();
}

function update_button(b) {
switch(b) {
case 1:
n = "not_loved.png";
h = "exclamation.png";
tooltip = "Last.fm is disabled, run monolite_lastfm_install.bat to enable it first";
func = null;
break;
case 2:
n = "exclamation.png";
h = "exclamation.png";
tooltip = "Please enter your Last.fm username / api key through context menu";
func = null;
break;
case 3:
n = "love.png";
h = "love.png";
tooltip = "This track is already loved!";
func = null;
break;
case 4:
n = "not_loved.png";
h = "love_h.png";
tooltip = love_command;
func = function() {love_track();}
}
Buttons = {
but: new Button(left_margin,top_margin, bw, bh, {normal: images_path + n, hover: images_path + h}, func, tooltip)
};
window.Repaint();
}

function on_metadb_changed() {
if(!g_metadb) return;
artist = fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb);
track = fb.TitleFormat("%title%").EvalWithMetadb(g_metadb);
love_command = "Last.fm Love '" + track + "' by '"+ artist + "'";
old_userloved = fb.TitleFormat("%LASTFM_LOVED_DB%").EvalWithMetadb(g_metadb) == 1 ? 1 : 0;
switch(true) {
case (is_lastfm.length == 0):
update_button(1);
break;
case (username.length == 0):
case (api_key.length != 32):
update_button(2);
break;
default:
(old_userloved == 1) ? update_button(3) : update_button(4);
}
}

function on_playback_new_track() {
on_item_focus_change();
}

function on_playback_time(time) {
if(time == 3) sync();
}

function love_track() {
fb.RunContextCommandWithMetadb(love_command, g_metadb);
sync();
}

function sync() {
if(username.length == 0 || api_key.length != 32) return(fb.trace("Playcount sync: Can't contact Last.fm. Check your username / API KEY settings."));
fb.trace("Playcount sync: Contacting Last.fm....");
lastfm("&method=track.getinfo&artist=" + encodeURIComponent(artist) + "&track=" + encodeURIComponent(track), "foo_playcount_sync", function() {process();});
}

function process() {
fb.trace("Playcount sync: Last.fm responded \"" + xmlhttp.statustext + "\"");
xmlDoc = xmlhttp.responseXML;
try { userplaycount = xmlDoc.getElementsByTagName("userplaycount")[0].childNodes[0].nodeValue; } catch(e) { userplaycount = 0;}
try { userloved = xmlDoc.getElementsByTagName("userloved")[0].childNodes[0].nodeValue; } catch(e) { userloved = 0; }
userloved == 1 ? update_button(2) : update_button(3);
fb.RunContextCommandWithMetadb("Customdb Love " + userloved, g_metadb);
fb.RunContextCommandWithMetadb("CustomdbU " + (userplaycount > 0 ? userplaycount.substring(userplaycount.length - 1) : "Erase"), g_metadb);
fb.RunContextCommandWithMetadb("CustomdbT " + (userplaycount > 9 ? userplaycount.substring(userplaycount.length - 2, userplaycount.length -1) : "Erase"), g_metadb);
fb.RunContextCommandWithMetadb("CustomdbH " + (userplaycount > 99 ? userplaycount.substring(userplaycount.length - 3, userplaycount.length - 2) : "Erase"), g_metadb);
fb.RunContextCommandWithMetadb("CustomdbTH " + (userplaycount> 999 ? userplaycount.substring(userplaycount.length - 4, userplaycount.length - 3) : "Erase"), g_metadb);
}

function on_size() {
ww = window.Width;
wh = window.Height;
}

function on_mouse_rbtn_up(x, y) {
var _menu = window.CreatePopupMenu();
var _child = window.CreatePopupMenu();
var idx;
_child.AppendMenuItem(MF_STRING, 101, "None");
_child.AppendMenuItem(MF_STRING, 102, (dui ? "Default UI " : "Columns UI ") + "default");
_child.AppendMenuItem(MF_STRING, 103, "Splitter");
_child.AppendMenuItem(MF_STRING, 104, "Custom ");
_child.AppendMenuItem(MF_SEPARATOR, 0, 0);
_child.AppendMenuItem(window.GetProperty("mode") == 104 ? MF_STRING : MF_GRAYED, 105, "Set custom colour...");
_child.CheckMenuRadioItem(101, 104, window.GetProperty("mode", 101));
_menu.AppendMenuItem(username.length > 0 ? MF_STRING : MF_GRAYED, 1, "Visit your Last.fm user profile page");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(is_lastfm.length > 0 ? MF_STRING : MF_GRAYED, 2, "Set your Last.fm username...");
_menu.AppendMenuItem(is_lastfm.length > 0 ? MF_STRING : MF_GRAYED, 3, "Set your API KEY...");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING | MF_POPUP, _child.ID, "Background");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
WshShell.run("http://www.last.fm/user/" + encodeURIComponent(username));
break;
case 2:
username = text_input_box("Playcount Sync", "Please enter your Last.fm username", username_file);
on_metadb_changed();
window.NotifyOthers("update", 1);
break;
case 3:
api_key = text_input_box("Playcount Sync", "Please enter your Last.fm API KEY\n\nhttp://www.last.fm/api/account", api_key_file);
on_metadb_changed();
window.NotifyOthers("update", 1);
break;
case 101:
case 102:
case 103:
case 104:
window.SetProperty("mode", idx);
window.Repaint();
break;
case 105:
custom_background = text_input_box("Playcount Sync", "Enter a custom colour for the background. Uses RGB. Example usage:\n\n234-211-74", custom_background_file);
window.Repaint();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
_child.Dispose()
return true;
}

function on_paint(gr) {
switch(window.GetProperty("mode", 102)) {
case 101:
col = null;
break;
case 102:
col = g_backcolor;
break;
case 103:
col = utils.GetSysColor(4);
break;
case 104:
temp_col = custom_background.split("-");
col = RGB(temp_col[0], temp_col[1], temp_col[2]);
break;
}
if(col) gr.FillSolidRect(0, 0, ww, wh, col);
buttonsDraw(gr);
}



I'm a complete newbie at foobar related programming, and was trying to go over the code for hours last night, but to no avail. The Console gives the following when trying to love a track:
QUOTE
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded "OK"


Can you tell what's wrong?

This post has been edited by gaurav: Mar 14 2011, 12:33
Go to the top of the page
+Quote Post
marc2003
post Mar 14 2011, 18:05
Post #352





Group: Members
Posts: 4465
Joined: 27-January 05
From: England
Member No.: 19379



this thread isn't the place to talk about a 3rd party script that just happens to use foo_softplaylists. it has nothing to do with this component's author at all.

however, the latest version of the script can be found here: http://cid-649d3bfeaf541fbb.skydrive.live....ount%20sync.zip
read the instructions carefully. discussion goes here: http://www.hydrogenaudio.org/forums/index....showtopic=76772
Go to the top of the page
+Quote Post
JohanDeBock
post Mar 15 2011, 10:12
Post #353





Group: Developer
Posts: 250
Joined: 23-March 05
Member No.: 20866



QUOTE (gaurav @ Mar 14 2011, 12:32) *
Cheers for the great plugin Johan!

Thanks!
QUOTE (gaurav @ Mar 14 2011, 12:32) *
2. When going to Library->Configure->Tools->Soft Playlists, it took a long time to display that page and to save any alterations.
It fetches top tags and your personal playlist list from last.fm.


--------------------
foo_softplaylists: http://tiny.cc/kh9m9
Go to the top of the page
+Quote Post
gaurav
post Mar 15 2011, 12:20
Post #354





Group: Members
Posts: 16
Joined: 21-February 10
From: India
Member No.: 78361



QUOTE (marc2003 @ Mar 14 2011, 22:35) *
however, the latest version of the script can be found here: http://cid-649d3bfeaf541fbb.skydrive.live....ount%20sync.zip
read the instructions carefully. discussion goes here: http://www.hydrogenaudio.org/forums/index....showtopic=76772

I'll go over the revised code. I had seen it before but mistook it for a component rather than a script.

QUOTE (JohanDeBock @ Mar 15 2011, 14:42) *
It fetches top tags and your personal playlist list from last.fm.

Ah, makes sense. wink.gif
Go to the top of the page
+Quote Post
carmenm
post Mar 18 2011, 09:47
Post #355





Group: Members
Posts: 720
Joined: 24-November 05
From: Grenoble
Member No.: 25981



I must i now find this plugin really essential!
At first i though why would i need to make a local playlist of my lastfm library... and the i started to use the Loved Tracks playlist. With it i can easily make playlist of my loved tracks and then push that playlist (with the files i mean) on my iPhone. It makes the best playlist ever when driving!

Know there is one thing i miss which is a way of filtering in that playlist. For example i see that loved tracks are sorted by love date which is GREAT. What i think would be awesome is to have a way when opening that playlist to choose the number of item we want in the playlist. It would allow to have the 40 or 50 last loved tracks.

Another way to do that (the most awesome way!) would be to have a custom tag in those playlist with love date (like done on lastfm radio playlists). That would create an infinity of possibilities. That way i could create filters like loved tracks of 2009 or last 50 loved tracks.
Is that somehting doable?

Thanks
Go to the top of the page
+Quote Post
.misiek
post Apr 15 2011, 21:50
Post #356





Group: Members
Posts: 14
Joined: 15-May 05
Member No.: 22078



First of all it is a brilliant plugin, but i've noticed that when i'm listening streaming radio from internet plugin reports:
QUOTE
foo_softplaylists: failed to love track: title and/or artist tag not present
, although title and artist is visible in foobar on both playlist and item details info, and plugin foo_audioscrobbler reports:
QUOTE
Audioscrobbler: Submitting track...
Audioscrobbler: Submission succeeded.
.
I suspect, that plugin takes title and artist directly from file tag instead of variables %title% and %artist%. Is that correct?


--------------------
my english sucks ... forgive me :/
Go to the top of the page
+Quote Post
SoulSmasher
post Apr 26 2011, 04:06
Post #357





Group: Members
Posts: 19
Joined: 11-June 09
Member No.: 70587



Just signed in to say thank you! This plugin was all I was missing at foobar2000. Can't see why I haven't seen this all the times. Thanks!

I just have a tiny question though. Not a big issue for me, so you can think this as a tiny suggestion. Sometimes the playlist adds same artist's (even same album's) tracks repedately. Is this normal ? After getting the queue, can the playlist be auto-shuffled and then generated?

Thanks again.
Go to the top of the page
+Quote Post
JJForums
post Apr 27 2011, 11:09
Post #358





Group: Members
Posts: 87
Joined: 31-January 08
Member No.: 50934



it's possible to create a link to the feature "love track", by clicking in something in the playlist, just to fast love the track and click again to unlove?
Go to the top of the page
+Quote Post
marc2003
post Apr 27 2011, 11:22
Post #359





Group: Members
Posts: 4465
Joined: 27-January 05
From: England
Member No.: 19379



add buttons to an existing toolbar (right click>customise). you'll probably need to find your own image resources though. or you could create keyboard shortcuts instead (file>preferences>keyboard shortcuts)
Go to the top of the page
+Quote Post
JJForums
post Apr 27 2011, 14:57
Post #360





Group: Members
Posts: 87
Joined: 31-January 08
Member No.: 50934



not to toolbar, but to playlist, like creating rating for music... did you get it?
Go to the top of the page
+Quote Post
marc2003
post Apr 27 2011, 15:16
Post #361





Group: Members
Posts: 4465
Joined: 27-January 05
From: England
Member No.: 19379



nope, that isn't possible.
Go to the top of the page
+Quote Post
JJForums
post Apr 27 2011, 22:08
Post #362





Group: Members
Posts: 87
Joined: 31-January 08
Member No.: 50934



so, isn't there a way to check if I marked a track with "love track"? and what happens if I forget that I already marked that track and mark it again as loved track?
Go to the top of the page
+Quote Post
Joffi
post Apr 28 2011, 21:37
Post #363





Group: Members
Posts: 26
Joined: 18-February 09
From: usa
Member No.: 67125



QUOTE (JJForums @ Apr 27 2011, 17:08) *
so, isn't there a way to check if I marked a track with "love track"? and what happens if I forget that I already marked that track and mark it again as loved track?

http://www.hydrogenaudio.org/forums/index....showtopic=76772 might have what you want

but it doesn't matter if you relove a track; it doesn't affect your last.fm account

This post has been edited by Joffi: Apr 28 2011, 21:38
Go to the top of the page
+Quote Post
romor
post May 16 2011, 04:05
Post #364





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



I got playlist stream in XSPF format, but foobar (Ctrl U) could not handle it. Searched for component and there are perhaps two available - foo_xspf which is outdated and can't be loaded and this one.

So after installing this component I expected that foobar could recognize XSPF stream (it's just like any other playlist only in XML format), but it couldn't unfortunately - it seems that this component can only load XSPF playlist from disk, and does not provide handle to foobar. Or am I wrong?


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
slyman
post May 26 2011, 03:18
Post #365





Group: Members
Posts: 22
Joined: 29-March 11
Member No.: 89385



QUOTE (.misiek @ Apr 15 2011, 15:50) *
First of all it is a brilliant plugin, but i've noticed that when i'm listening streaming radio from internet plugin reports:
QUOTE
foo_softplaylists: failed to love track: title and/or artist tag not present
, although title and artist is visible in foobar on both playlist and item details info, and plugin foo_audioscrobbler reports:
QUOTE
Audioscrobbler: Submitting track...
Audioscrobbler: Submission succeeded.
.
I suspect, that plugin takes title and artist directly from file tag instead of variables %title% and %artist%. Is that correct?

im having the same problem did you ever figure this out?
Go to the top of the page
+Quote Post
JohanDeBock
post Jun 18 2011, 11:49
Post #366





Group: Developer
Posts: 250
Joined: 23-March 05
Member No.: 20866



QUOTE (romor @ May 16 2011, 04:05) *
So after installing this component I expected that foobar could recognize XSPF stream (it's just like any other playlist only in XML format), but it couldn't unfortunately - it seems that this component can only load XSPF playlist from disk, and does not provide handle to foobar. Or am I wrong?


Indeed foo_xspf is made for playlists that reference to the location of a music file.

This plugin is made for playlists that only reference the tag data like which artist, which track, which album.
If you load such a playlist it will match the tags with your local library and make a playlist with all the tracks it could match.
It can also save a playlist to such a XSPF file.
This can be very handy if you want use the playlist on another computer with all your music but in different paths.
Is also very handy if you play your music from your ipod in disk mode from within foobar and want to use the same playlists that you use elsewhere.


--------------------
foo_softplaylists: http://tiny.cc/kh9m9
Go to the top of the page
+Quote Post
romor
post Jun 18 2011, 12:46
Post #367





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



Johan, I knew about some nifty features like matching XSPF contents with local library which can have many interesting scenarios and that's great

I found updated version of foo_xspf for foobar2000 v1.0 (hidden at the bottom of author's blog) and while it adds support for this playlists it can't parse some, resulting only in partial playlist contents

I don't know how popular XSPF format is, but I parsed XSPF with sed (extracting only links) to M3U and for some I liked I embedded playlist in one of available Flash XSPF players (like http://www.xspf-player.com)


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
BASGTA
post Jun 18 2011, 15:26
Post #368





Group: Members
Posts: 14
Joined: 1-September 09
Member No.: 72832



How do you set up the Media Library? I have mine set to view G:\Music but it doesn't see anything. Does the Media Library not look into subfolders?
Go to the top of the page
+Quote Post
the
post Jun 27 2011, 18:33
Post #369





Group: Members
Posts: 17
Joined: 28-April 11
Member No.: 90180



@JohanDeBock: Is it maybe possible to get the feature to save and load xspf playlists in an own component? I like to keep my foobar menu simple and unfortunately the foo_xspf component seems not to work correctly as romor states.
Go to the top of the page
+Quote Post
squrl
post Jul 8 2011, 18:17
Post #370





Group: Members
Posts: 1
Joined: 8-July 11
Member No.: 92151



Hi there,

I am using this awesome foobar2000 skin, it has a little "heart" icon which, when clicked, sets the rating of currently played song to five * (stars). When clicked again, it resets the rating back to 0 *. Using foo_softplaylists, I'd like to turn this into Last.fm Love/Unlove button, but I have no experince in scripting, is there someone kind a patient enough, who would care to help me out, or at least point me in the right direction??

The rating script looks like this:
CODE
var Path =  fb.FoobarPath+"skins\\Metro\\";
var BgImage = gdi.Image(Path + "heart_empty.png");
var HeartImage = gdi.Image(Path + "heart.png");
var Rating = fb.TitleFormat("%rating%").eval();

function UpdateRating(rate){
    fb.RunContextCommand("Rating/" + rate);
    var new_rate = fb.TitleFormat("%rating%").eval();
    if(new_rate == "?"){
        var meta = fb.GetNowPlaying();
        meta.UpdateFileInfoSimple("RATING",rate);
    }
    Rating = rate;
}

function ClearRating(){
    fb.RunContextCommand("Rating/<not set>");
    var meta = fb.GetNowPlaying();
    meta.UpdateFileInfoSimple("RATING","");
    Rating = 0;
}

function on_paint(gr){
    var g_bgcolor = window.GetColorCUI(3);
    gr.FillSolidRect(0, 0, window.Width, window.Height, g_bgcolor);
    if(Rating == 5){
        gr.DrawImage(HeartImage, 0, 0, 15, 13, 0, 0, 15, 13 , 0);}
    else{
        gr.DrawImage(BgImage, 0, 0, 15, 13, 0, 0, 15, 13 , 0);
    }
}

function on_mouse_lbtn_down(x, y) {
    if(!fb.IsPlaying){return}
    if(Rating == 5){ClearRating()}else{UpdateRating(5)}
    window.Repaint();
}

function on_playback_new_track(info){
    Rating = fb.TitleFormat("%rating%").eval();
    window.Repaint();
}

function on_metadb_changed(metadb, fromhook) {
    Rating = fb.TitleFormat("%rating%").eval();
    window.Repaint();
}

function on_colors_changed() {
    window.Repaint();  
}

Shouldn't be hard to modify, should it?

Any help is very much appreciated. Thanks in advance, squrl.
Go to the top of the page
+Quote Post
Steve Forte Rio
post Jul 9 2011, 12:15
Post #371





Group: Members
Posts: 453
Joined: 4-October 08
From: Ukraine
Member No.: 59301



Hi! I have a feature request: could you add the ability to change the tag fields for sending track information to the last.fm DB?
For example: I want to replace %artist% with %composer%.
Please!

This post has been edited by Steve Forte Rio: Jul 9 2011, 12:18
Go to the top of the page
+Quote Post
jayg30
post Jul 30 2011, 19:52
Post #372





Group: Members
Posts: 10
Joined: 4-May 08
Member No.: 53268



Hello,

I've never seemed to be able to use this plugin for what I want, love/ban tracks. It will create playlists from the top/loved/recent tracks tho. No matter what I try it just won't work for love/unlove/ban/unban.

Here is the console error;
QUOTE
foo_softplaylists: feed downloading: error
foo_softplaylists: failed to love track: authentication failed: empty reply
foo_softplaylists: failed to love track 'Good Directions' by 'Billy Currington'


Again this is what I get regardless of what track I try.
Yes, I have provided my username and password in the softplaylist menu and I'm very confident it is correct.
They are the same that I provide for foo_audioscrobbler and foo_lastfm_radio which both work perfectly.
No, I do not use any buttons, just access it through the context menu.
I even installed a brand new portable installation with no other components and it still fails.
I've tried with all different file types (flac, ogg, mp3) but that doesn't make a difference.

I'd really like to have this feature working, could someone please help me.
Go to the top of the page
+Quote Post
maXelo
post Aug 31 2011, 20:15
Post #373





Group: Members
Posts: 25
Joined: 3-July 10
From: Valdivia, Chile
Member No.: 81992



I love this plugin, but I've been wondering if it is possible to exclude "EP"s (Extended Play) versions of songs? on the playlists. I know that one can choose oldest or latest tracks, but it will be great to avoid certain types of songs.
Go to the top of the page
+Quote Post
tg2k3
post Sep 16 2011, 22:14
Post #374





Group: Members
Posts: 45
Joined: 10-June 05
Member No.: 22635



hey, awesome component!!

does your component or the xspf format in general have a way of dealing with matching tags that are only partially identical? i have a way of creating xspf playlists from public databases. often however my files are tagged slightly differently, e.g. mentioning some extra information or a little less in comparison to the xspf file. right now, i need to manually edit the xspf file which kind of defeats the whole purpose of it.

thanks a lot for your time!
Go to the top of the page
+Quote Post
hymerman
post Oct 14 2011, 14:40
Post #375





Group: Members
Posts: 85
Joined: 1-June 05
Member No.: 22429



Do you think you could make the source to this available, Johan? I'd like to play around with how it chooses tracks from my library (specifically, prefer original releases rather than live/ep/compilations, and use original date rather than release date). I know it's probably annoying to have all these feature requests; open sourcing it and letting people do it themselves will help smile.gif
Go to the top of the page
+Quote Post

17 Pages V  « < 13 14 15 16 17 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th September 2014 - 10:05