|
|
#1 |
|
Senior Member
Join Date: Oct 2006
Posts: 353
|
metadata not returned for long filenames by Pledit..x
When a filename (name+path) exceeds about 64 characters Pledit.getmetadata does not properly return the data.
This was found after a clean install and is fully reproduceable. To reproduce: 1. Insert into pledit-normal.xml <text id="PLtest" default="TEST" x="174" y="4" w="64" h="16" font="ariel" align="left" valign="top" fontsize="16" color="font.display" /> after <button id="pl.misc" ... 2. Modify pledit.m --------------------------------------------- #include <lib/std.mi> #include <lib/pldir.mi> #include "attribs.m" Global Layout pl_normal; Global Layout pl_shade; Global text PLtest; Global PlEdit PeListener; Global Group frameGroup; System.onScriptLoaded() { initAttribs(); menubar_pe_attrib.onDataChanged(); pl_normal = getScriptGroup().getParentLayout(); PeListener = new PlEdit; frameGroup = getScriptGroup(); PLtest = frameGroup.findObject("PLtest"); } PLtest.onLeftButtonUp(int x, int y) { int ccount = System.getPlaylistLength()-1; int cIndex = 0; while (cIndex <= ccount) { // For all tracks string metadata = PlEdit.getFileName(cindex); System.debugString("file ["+metadata+"] ",9); metadata = PlEdit.getMetaData(cindex,"length"); string ctitle = PlEdit.getMetaData(cindex,"title"); System.debugString(" "+integertostring(cindex)+" length ["+metadata+"] "+ctitle,9); metadata = PlEdit.getMetaData(cindex,"stereo"); System.debugString(" stereo ["+metadata+"] ",9); cindex = cindex + 1; } } menubar_pe_attrib.onDataChanged() { ......... --------------------------------------------- 3. compile pledit 4. load several music tracks (any format) into the playlist editor. Some should have very short names, and some names longer than 80 character. 5. Click on the word TEST at the bottom of the playlist editor and then examine the resulting wasabi.txt file. 6. You will readily see that long file names do not work, and short ones are AOK. |
|
|
|
|
|
#2 |
|
Android/UI Development
|
i've noted it down
maybe i have time to fix it (if i can repro) for next release, otherwise PM me |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Oct 2006
Posts: 353
|
Thank you. Also I counted the number of characters and it seems that if the full path is longer than 129 characters, the file name is truncated to 129 and the metadata is not returned. This should be a relatively simple fix, but then you never know.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|