Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1386213 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3025
As you can see there's nothing particularly special about a file itself. Once you load a playlist file or stream url in foobar, creating an m-TAGS file simply saves the information in a text file. You can then edit this static information.

Code: [Select]
[
  {
      "@" : "http://50.7.77.114:8114/",
      "GENRE" : "House",
      "TITLE" : "EDM1.fm -- House Party",
      "URL" : "EDM1.fm/HouseParty"
  },
  {
      "@" : "http://50.7.77.114:8399/",
      "GENRE" : "Progressive (Underground)",
      "TITLE" : "EDM1.fm -- Progressions",
      "URL" : "EDM1.fm/Progressions"
  },
  {
      "@" : "http://50.7.77.114:8573/",
      "GENRE" : "Vocal Trance, Progressive House",
      "TITLE" : "EDM1.fm -- Sublime (Pure Vocal melodies)",
      "URL" : "EDM1.fm/Sublime"
  },
  {
      "@" : "http://50.7.77.114:8387/",
      "GENRE" : "Tech House",
      "TITLE" : "EDM1.fm -- **NEW** Tech House",
      "URL" : "http://www.EDM1.fm/TechHouse"
  },
  {
      "@" : "http://50.7.77.114:8540/",
      "GENRE" : "Electro, Progressive House",
      "TITLE" : "EDM1.fm -- The Drop",
      "URL" : "EDM1.fm/The Drop"
  },
  {
      "@" : "http://50.7.77.114:8408/",
      "GENRE" : "Trance",
      "TITLE" : "EDM1.fm -- Trancemitter",
      "URL" : "EDM1.fm/Trancemitter"
  },
  {
      "@" : "http://50.7.77.114:8418/stream",
      "GENRE" : "Downtempo",
      "TITLE" : "EDM1.fm Chillzone -- Chillout Classics",
      "URL" : "http://edm1.fm/chilloutclassics"
  }
]

If you open the Properties dialog and view the Properties tab for a playlist entry, you'll see, for example:
Code: [Select]
File name : EDM1.fm.tags
Folder name : C:\Users\~\Music\MTags
File path : C:\Users\~\Music\MTags\EDM1.fm.tags
Subsong index : 4
File size : 1.23 KB (1 263 bytes)
Last modified : 2014-05-09 14:47:33
Sample rate : 44100 Hz
Channels : 2
Bitrate : 256 kbps
Codec : MP3
Encoding : lossy
Added : 2014-05-09 14:41:55
<@> : http://50.7.77.114:8387/
<@REFERENCED_FILE> : http://50.7.77.114:8387/
<@REFERENCED_INDEX> : 0
<MP3_STEREO_MODE> : joint stereo


WSH Panel Mod script discussion/help

Reply #3027
Hmm I don't know what was up with those streams when you tried them.

Anyhow the Thumbs script doesn't crash WSH Panel Mod now, but the automatic downloading only works maybe 20% of the time. Console only gives a 404 message. It does work if I manually trigger it.

The main issues I'm seeing are related to album info. That's expected since that is often not present in streams; however, I've tried some scripts (where possible) which grab the album info when it's in the title tag or in the URL, but nothing happens.

WSH Panel Mod script discussion/help

Reply #3028
from the foo_tags thread...

Now m-TAGS merges its tags with the dynamic info. Please note that m-TAGS takes precedence, i.e. the dynamic tag is shown if the m-TAGS file does NOT contain that tag.


if you have title defined in your tags file, you can't access the dynamic title in the stream.

 

WSH Panel Mod script discussion/help

Reply #3029
That statement by the developer just doesn't mesh with my use of the component. I can see and manipulate dynamic titles and URLs for display purposes and for use in foo_audioscrobbler.

When I tried inputting my "album" scripts into your scripts, I got a message from the component they were too long lol or your script gave me a "Not Found", crashed or did nothing.

Any idea what the issue with the Thumbs script could be?

WSH Panel Mod script discussion/help

Reply #3030
That statement by the developer just doesn't mesh with my use of the component.


well that conflicts with my own testing. for me, it behaves like the developer said it would.

admittedly i'm not using anything with dynamic album or title - just the artist. i tested this bbc radio stream...

http://bbc.co.uk/radio/listen/live/r2.asx

if i start with a blank WSH panel and add this bit of code to output the artist to the console every second.

Code: [Select]
window.SetInterval(function() {
    fb.trace(fb.TitleFormat("%artist%").Eval(true));
}, 1000);


it displays BBC when playback is stopped and BBC Radio 2 when the stream is playing.

when i create a tags file with the artist set to BBC test, that's all the console outputs.

Code: [Select]
[
   {
      "@" : "mms://wmlive-acl.bbc.co.uk/wms/bbc_ami/radio2/radio2_bb_live_ep1_sl0?BBC-UID=a5d3267e7c5e856658f4445661b55373b9b59192605021f414ffa4a6e3baa91a&SSO2-UID=|0",
      "ARTIST": "BBC test"
   }
]


it never changes to BBC Radio 2 when playing. as soon as i edit the tags file to remove the artist and reload the file in the playlist, it does then display the dynamic BBC Radio 2 title when playing. this is completely at odds with what you're saying.

as for the thumbs script, it doesn't support automatically downloading when the stream artist changes. i guess i should add something in the readme to clarify this.

Quote
I got a message from the component they were too long lol


hold shift and right click the panel>properties. you should be able to enter longer title formatting strings there. it's generally artist_tf for most scripts. the values in the allmusic script should be self explanatory if you're using that.

WSH Panel Mod script discussion/help

Reply #3031
Here's what I see in the Console with your code

using %artist% (No artist tags in my m-TAGS files)



using %title% (I do have title tags in my m-TAGS files)



using %url%  (I do have url tags in my m-TAGS files)



Maybe we have different versions of the component?

WSH Panel Mod script discussion/help

Reply #3032
Maybe we have different versions of the component?


perhaps?? i'm using 0.1

anyway, what started it all was this...

Quote from: BenB link=msg=0 date=
The main issues I'm seeing are related to album info. That's expected since that is often not present in streams; however, I've tried some scripts (where possible) which grab the album info when it's in the title tag or in the URL, but nothing happens.


you're going to have to be more specific about what you're doing and what you're expecting to happen. what script, what custom title formatting are you using, what stream? what happens when you bypass foo_tags and play the stream directly?

WSH Panel Mod script discussion/help

Reply #3033
Sorry to resurrect...

This is a great mod, Glad I found it!

I'm wondering if anyone knows how to show an image named "front.jpg" or "cover.jpg" which is located in the same folder as the "disc.png" image used for the spinning disc? The plain gray background is kinda boring, I thought it'd be cool to use the album front cover as the background.

Thanks!


Updated Spinning disc script here

Added: Display now playing disc first, if not available  display default disc image.
(set source in Preferences/Display-Album art Disc)

Added: gradient background.
Added: disc mask. (now you can display non transparent disc images like  jpg. just use correctly cropped images (edge to edge)).

screen-shot with jpg disc image



WSH Panel Mod script discussion/help

Reply #3034
perhaps?? i'm using 0.1

I have a few versions and they're all 0.1 LMAO

Anyhow I think I know why I can access the info and you can't. Look at the properties of a station referenced by an m-TAGS file. If <@REFERENCED_FILE> is blank, your scripts cannot access the dynamic info (although foobar can). I'm fairly sure you can solve this by ticking "Only use absolute paths in references" in foo_tags' Advanced Preferences. (I also have "Ignore source tags" and "Replace existing files" ticked. I don't think they'd have any effect, but who knows?).

you're going to have to be more specific about what you're doing and what you're expecting to happen. what script, what custom title formatting are you using, what stream? what happens when you bypass foo_tags and play the stream directly?

I've managed to get the Allmusic script working somewhat. I'll do some more testing before I bitch and whine at you some more 

WSH Panel Mod script discussion/help

Reply #3035
If <@REFERENCED_FILE> is blank, your scripts cannot access the dynamic info (although foobar can).


that's because i was checking the value of @REFERENCED_FILE to see if it was a stream. if it was missing, it was falling back to %path%. i've changed it to check the value of the @ field instead.

https://dl.dropboxusercontent.com/u/2280132...temp/common7.js

@oatmeal769, drawing one image over the top of the other and spinning results in pretty much unusable performance. it's not worth it.

WSH Panel Mod script discussion/help

Reply #3036
Thanks marc. It seems to be working better now, but I'm still having having some issues with the Allmusic album script. I've tried several scripts and this version of the part for grabbing the album info from the url seems to work best (although some seem to match but return nothing):

Quote
$if($and(%url%,$strstr(%url%,&album=),$not($strstr(%url%,&album=&))),
$replace($substr(%url%,$add($strstr(%url%,&album=),7),$sub($strstr(%url%,&duration),1)),
%%20, ,%%21,!,%%22,",%%23,#,%%24,$,%%25,%%,%%26,&,%%27,'',%%28,'(',%%29,')',%%2A,*,%%2B,+,%%2C,',',%%2D,-,%%2E,.,%%2F,/,%%3A,:,
%%3B,;,%%3C,<,%%3D,=,%%3E,>,%%3F,?,%%40,@,%%5B,'[',%%5C,\,%%5D,']',%%5E,^,%%5F,_,%%60,`,%%7B,{,%%7C,|,%%7D,},%%7E,~,%%A1,¡,%%A2,¢,%%A3,£,%%A9,©,
%%AA,ª,%%AE,®,%%B0,°,%%B2,²,%%B3,³,%%B4,´,%%B9,¹,%%BA,º,%%BF,¿,%%C0,À,%%C1,Á,%%C2,Â,%%C3,Ã,%%C4,Ä,%%C5,Å,%%C6,Æ,%%C7,Ç,%%C8,È,%%C9,É,%%CA,Ê,
%%CB,Ë,%%CC,Ì,%%CD,Í,%%CE,Î,%%CF,Ï,%%D0,Ð,%%D1,Ñ,%%D2,Ò,%%D3,Ó,%%D4,Ô,%%D5,Õ,%%D6,Ö,%%D7,×,%%D8,Ø,%%D9,Ù,%%DA,Ú,%%DB,Û,%%DC,Ü,%%DD,Ý,%%DE,Þ,
%%DF,ß,%%E0,à,%%E1,á,%%E2,â,%%E3,ã,%%E4,ä,%%E5,å,%%E6,æ,%%E7,ç,%%E8,è,%%E9,é,%%EA,ê,%%EB,ë,%%EC,ì,%%ED,í,%%EE,î,%%EF,ï,%%F0,ð,%%F1,ñ,%%F2,ò,%%F3,ó,
%%F4,ô,%%F5,õ,%%F6,ö,%%F7,÷,%%F8,ø,%%F9,ù,%%FA,ú,%%FB,û,%%FC,ü,%%FD,ý,%%FE,þ,%%FF,ÿ,),%album%)

However, I'm having an issue with double quotes (emphasized in red, above). It's inclusion breaks your script and my code. If I escape it with single quotes, it fixes that particular problem, but those single quotes also break the script/code. The only way to make it work is to remove the double quote character, but that potentially breaks the album matching. Any ideas on how I can fix it?

Also, how are the albums matched, and must they be exact matches or is there a little wiggle room?

WSH Panel Mod script discussion/help

Reply #3037
i tried re-creating your scenario and your code works fine. you did use the properties dialog and didn't try editing the script??



there is a javascript function i could use to get rid of that massive replace string that does it all for you called decodeURIComponent. if i add it, i'll let you know.

as for matching, it has to be pretty much exact. i use the $ascii title formatting function on the search term/results and also ignore &/and and make everything lower case.

WSH Panel Mod script discussion/help

Reply #3038
i tried re-creating your scenario and your code works fine. you did use the properties dialog and didn't try editing the script??

I somehow introduced an error into the script at some point adding it in the properties dialog. I also added it to the script in the panel where the double quotes cause my code to break (which is where I got the idea it was also breaking your script).

there is a javascript function i could use to get rid of that massive replace string that does it all for you called decodeURIComponent. if i add it, i'll let you know.

This would help as I think I will have to add another $replace() to clean up some of the junk in order to get more matches. That replace string is actually pared down to what I thought I could get away with. It was much bigger. I might be able to pare it down a little more.

as for matching, it has to be pretty much exact. i use the $ascii title formatting function on the search term/results and also ignore &/and and make everything lower case.

I figured it was fairly tight because sometimes what appears to be matches return nothing. I've yet to find the cause in those instances.

Many times what's in the url for album is incorrect or incomplete. Album subtitles are either missing or are used in place of the album title    and a missing initial "The" and Allmusic's extraneous information in brackets/parentheses following the actual album title seems to be also preventing matches. I can see why most media players ignore the information. I'm about ready to give up and use it solely for display purposes because it's not really worth the aggravation of constantly tweaking it.

WSH Panel Mod script discussion/help

Reply #3039
i really can't be bothered to test this properly but you can try adding to the allmusic panel. just stick it at the end.

Code: [Select]
t.tidy = function(text) {
    return decodeURIComponent(fb.TitleFormat("$replace($lower($ascii(" + text + ")), & ,, and ,)").Eval(true));
}


then your own title format code can be simplified to only extract the album from the URL if present.

Code: [Select]
$if($and(%url%,$strstr(%url%,&album=),$not($strstr(%url%,&album=&))),$substr(%url%,$add($strstr(%url%,&album=),7),$sub($strstr(%url%,&duration),1)),%album%)


i just don't have the skills to make it better at matching. i expect something better is possible but i wouldn't know where to begin.


WSH Panel Mod script discussion/help

Reply #3040
@BenB, ignore that function in the post above. it won't work. it doesn't do anything to the search term before it's sent. i'll have to think about it some more.

WSH Panel Mod script discussion/help

Reply #3041
Anyone? It can't be too hard, but I'm a novice at writing this stuff, and don't want to mess it up.
Thanks!

Sorry to resurrect...
This is a great mod, Glad I found it!

I'm wondering if anyone knows how to show an image named "front.jpg" or "cover.jpg" which is located in the same folder as the "disc.png" image used for the spinning disc? The plain gray background is kinda boring, I thought it'd be cool to use the album front cover as the background.

Thanks!


Updated Spinning disc script here

Added: Display now playing disc first, if not available  display default disc image.
(set source in Preferences/Display-Album art Disc)

Added: gradient background.
Added: disc mask. (now you can display non transparent disc images like  jpg. just use correctly cropped images (edge to edge)).

screen-shot with jpg disc image

[img]



WSH Panel Mod script discussion/help

Reply #3042
i did answer your question but you must have missed it as it was bolted onto the end of one of my posts.

@oatmeal769, drawing one image over the top of the other and spinning results in pretty much unusable performance. it's not worth it.

WSH Panel Mod script discussion/help

Reply #3043
i did answer your question but you must have missed it as it was bolted onto the end of one of my posts.
Yes, I did, sorry.  Thank you though, at least I know.

WSH Panel Mod script discussion/help

Reply #3044
@BenB, ignore that function in the post above. it won't work. it doesn't do anything to the search term before it's sent. i'll have to think about it some more.

I saved it, but only got a chance to test it this morning. I should've read the forum first. Thanks for trying

WSH Panel Mod script discussion/help

Reply #3045
Well, I figured out how to make the BG a solid black, which is better than the gray I suppose.
i did answer your question but you must have missed it as it was bolted onto the end of one of my posts.

@oatmeal769, drawing one image over the top of the other and spinning results in pretty much unusable performance. it's not worth it.



WSH Panel Mod script discussion/help

Reply #3046
Hey marc2003 I've been getting this on the console

Quote
Last.fm & Wikipedia Biography: <html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.4.7</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->


dunno if it's a problem form my end or from something else

WSH Panel Mod script discussion/help

Reply #3047
it's working fine for me at the moment so hopefully it was just a temporary glitch at the time you posted??

WSH Panel Mod script discussion/help

Reply #3048
@BenB, ignore that function in the post above. it won't work. it doesn't do anything to the search term before it's sent. i'll have to think about it some more.

I saved it, but only got a chance to test it this morning. I should've read the forum first. Thanks for trying


edit: i did post something but i need to test it first. 

WSH Panel Mod script discussion/help

Reply #3049
@BenB, just right click your allmusic panel and Update script. make sure the script inside the panel is untouched (without that snippet i posted the other day). now you should be able to get rid of that super long $replace function.