zoidy / walkmanmtp

Automatically exported from code.google.com/p/walkmanmtp
0 stars 0 forks source link

same file/folder names may cause unpredictable behaviour #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
having two files with the same name in the same folder, while allowed by
the MTP protocol, will cause unpredictable behaviour in the program. 
Similarly, having two files or folders with the same name but in different
directories is unsupported for now

Original issue reported on code.google.com by rios.fer...@gmail.com on 3 Apr 2008 at 12:47

GoogleCodeExporter commented 9 years ago

Original comment by rios.fer...@gmail.com on 3 Apr 2008 at 12:48

GoogleCodeExporter commented 9 years ago
a possible solution to this would be to maybe use an index based on what order 
the
files actually appear in a folder (i.e. the order they are returned in by
enumerateStorage).  The combination of ParentName, ParentIndex, Directory 
Depth, File
Name, File Index should uniquely identify a file.  Even in the case of 2 
identical
folders containing each containing an identical file, a file in any of the 
folders
can be uniquely identified based on the index of the parent

all of this assumes that the index of a file doesn't change each time the folder
contents are enumerated if no files have been added or deleted from the player 
(it
will obviously change, if the folder contents have changed)

possible problem with this approach: adding files (the way it's done as of v 
0.3.0.2)
the index of the file being added won't be known until the player contents are
enumerated again. this means that the file can't be properly added to the 
listview

Original comment by rios.fer...@gmail.com on 18 Apr 2008 at 1:10

GoogleCodeExporter commented 9 years ago
possible solution #2: use the PersistentUniqueID of the item.  This makes it 
easy to
uniquely identify a file. The only drawback is that the ID can't be guaranteed 
to be
known ahead of time.  Therefore, to read the music files in the MUSIC 
directory, for
example, it's still necessary to find this folder by searching for the matching 
name
and level

Original comment by rios.fer...@gmail.com on 27 Apr 2008 at 2:52

GoogleCodeExporter commented 9 years ago
As of r16, the program uses PersistentUniqueID to identify items (except in
circumstances as described in c3 above). Still need some small changes to MTPAxe
(save the ID of the parent storage of each item) and WMTP (changes to playlist
management) to get this working

Original comment by rios.fer...@gmail.com on 29 Apr 2008 at 12:36

GoogleCodeExporter commented 9 years ago
done. r21

Original comment by rios.fer...@gmail.com on 6 May 2008 at 2:12