|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2012
Posts: 3
|
File paths contains %20 characters instead of spaces in playlist
I'm using a custom-made music web app, where I store all my music, from which I drag and drop href links from local music files into Winamp playlists.
Here is an example of such a link: <a href="c:\tmp\cdaudio2\DJ-Kicks - Motor City Drum Ensemble\01-va-dj-kicks_mixed_by_motor_city_drum_ensemble.mp3" draggable="true" ondragstart="drag(event)"><img src="images/dragme.gif"></a> There is a javascript on the web page that carefully writes the file location, without %20, into the draggable object value. function drag(ev) { ev.dataTransfer.setData("Text",decodeURIComponent(ev.target.href)); // removes %20 chars } I then drag the link from the web browser window, into winamp playlist. It should work, as the ATF filename value %filename% displays the correct path to the music file in Winamp. For example, this is what I see when look at the ATF %filename% value in winamp: c:\tmp\cdaudio2\DJ-Kicks - Motor City Drum Ensemble\01-va-dj-kicks_mixed_by_motor_city_drum_ensemble.mp3 But, when I look at the file info field (Alt+3), I get this instead: c:\tmp\cdaudio2\DJ-Kicks%20-%20Motor%20City%20Drum%20Ensemble\01-va-dj-kicks_mixed_by_motor_city_drum_ensemble.mp3 All the spaces are converted into %20 characters, making it impossible for winamp to play the said file. Is there any way to replace the %20 with spaces in the filename?? Obviously, ATF applies to Titles only, but any chances in configuring the way Winamp handles filenames ??? Thanks in advance, I've been fiddling for quite a while on this one. |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,819
|
Hi,
Have you tried the miscellaneous options in the General Preferences - Titles group? One is for showing underscores as spaces, the other is for showing %20 characters as spaces. Windows 10 Home 64-bit v21H2 desktop - Logitech Z906 5.1 speaker system |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2012
Posts: 3
|
Hi, thx for the tip. Unfortunately, this option only replaces %20 to spaces within song titles, not within song filenames.
This is what I need to do, replace %20 with spaces in filenames. Anyone? |
|
|
|
|
|
#4 |
|
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,819
|
It's curious that Winamp would convert the spaces to "%20" characters.
From your example, it appears the string is enclosed in parentheses, so it should be accepted intact. Maybe Windows is dropping the parentheses when you drag and drop the link and adding the "%20" characters. Can you use the clipboard to copy and paste the link or drag and drop it to a text file in Notepad? Are the parentheses stripped and/or the "%20" characters added? I'm really just thinking out loud here. Windows 10 Home 64-bit v21H2 desktop - Logitech Z906 5.1 speaker system |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2012
Posts: 3
|
Thx for the suggeston Aminifu!
When I drag&drop the object in Notepad, it appears intact, with spaces instead of %20. So the string does seems ok in Notepad. That's why I'm wondering why it gets padded wih %20 once dropped in Winamp Playlist editor... |
|
|
|
|
|
#6 |
|
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,819
|
Sounds like you may have found a bug. Hopefully one of the WA devs will respond to your issue.
Windows 10 Home 64-bit v21H2 desktop - Logitech Z906 5.1 speaker system |
|
|
|
|
|
#7 |
|
Join Date: Sep 2003
Posts: 27,873
|
Winamp (and Foobar2000 as from the other thread which was made about this here isn't pointing at this just being the players working with the data they are getting (as i know from what i've seen of the Winamp code that it won't convert paths in the manner described _unless_ it's happening before it gets to Winamp, etc or is being generated by and OS path handling function).
i have quickly tried it and if the folder path is free from spaces it's fine (even if the file has spaces in it's name), but as soon as there is a space in the folder then it goes wrong (which matches with what was seen by foosion - does irk me people posting the same thing on multiple forums). dragging to the desktop give the same link with %20 instead of spaces which matched with my suspicion when starting this reply that it's not a Winamp issue and has to be down to how the data is formatted from the browser (used Firefox beta, current Chrome [doesn't support it], IE9, current Opera). so what is being wanted is a wish as however it may seem, Winamp is doing everything as expected with the drag & drop handling in that it's using what it's provided which is all it generally should be doing. yes it probably should look at the data and try to re-process before adding to the playlist but would need to look at the entry and only process on non-url entries (which would slow drag + drop down a bit especially with large drops). -daz |
|
|
|
|
|
#8 |
|
Join Date: Sep 2003
Posts: 27,873
|
seems to be because of how Firefox, etc are creating the drag and drop object, at least on the Winamp side it's being attempted to be processed as an URL (note: it's already got the %20 before anything is done) since it's getting a URL option which it then attempts to use.
by trying to check if what is passed is an url or just masquerading as an url when it's not, if it can be reliably determined as not being a true url, pre-pending file:/// to the start and using PathCreateFromUrl(..) will from a quick test create a valid local filepath. how stable that would be in general use i cannot say as the test for an url vs not an url is the main aspect since if not done right it'd break other url based options which currently are handled. so whether this makes it into the next release or not completely depends on how testing goes and which side of a release i can get around to doing that. -daz |
|
|
|
|
|
#9 | |
|
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,819
|
Quote:
While it was fun, on one level, to figure out how to handle such things when I was a paid programmer. These are also the type of things that make me glad I'm no longer programming for a living. DrO, I take it that this issue also bothers you or are you being generous with your personal time again? Anyway, thank you for trying to sort this handling issue out and good luck with a 'fix'. Windows 10 Home 64-bit v21H2 desktop - Logitech Z906 5.1 speaker system |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|