Not logged in. · Lost password · Register
Forum: Skins RSS
SavePlaylistTo
little help please
scumbkt19 (Guest) #1
No profile available.
Link to this post
I've noticed that pressing "save" on the playlist screen (of the base skin) saves the current playlist to whichever folder was last browsed to through the browser screen.  Is there a way to specify where playlists should be saved?  I noticed a SavePlaylistTo method within the source (player.cpp), but I don't know how to access it from the webpage.

Thanks!
Avatar
Henry (Administrator) #2
Member since Jan 2003 · 865 posts · Location: Munich Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Actually there is no way to specify the directory where the playlist is written to. You have to browse in that folder as you described.
scumbkt19 (Guest) #3
No profile available.
Link to this post
then how 'bout making this my official request for a new feature.
scumbkt19 (Guest) #4
No profile available.
Link to this post
so i made it work, although it's not the prettiest thing i've ever written, i'm new to javascript.  Here's how i did it:

1. change the "save" form so that it will run a function
<form name="saveName"><table>
   <tr>
      <td colspan=3 align=center>
         <input type=text name="playlistname" size=10>
  <input type="button" name="button" value="  save  " onClick="save()">
      </td>
   </tr>
   <tr><td></td></tr>
</table></form>

2. save() is a simple redirect to the playlist directory (hardcoded   :( ) with the name of the playlist tacked on to the end
document.location.href("?dir=E%3A%5CMy+Music%5CMy+Playlists&"+document.saveName.playlistname.value+"&save")

3. add onLoad="checkSave()" to the <body> tag, this function parses the url for the name and then redirects to "?saveplaylist=" as in the original save button
function checkSave()
{
   var string = new String(document.location.search)
   if(string.indexOf("&save")==-1) return;
   var name = string.substring(string.indexOf("&")+1,string.lastIndexOf("&",string.length))
   document.location.href("?saveplaylist="+name)
}

comments and improvements would be much appreciated
Avatar
Henry (Administrator) #5
Member since Jan 2003 · 865 posts · Location: Munich Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I'd say this is a really nice workaround.  :thumbup:
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Page created in 144.2 ms (64.8 ms) · 48 database queries in 57.1 ms
Current time: 2018-08-16, 21:33:00 (UTC +00:00)