This is a pet project :)
I have hundreds of playlist files .m3u whose many entries have a wrong path. I'd like to fix them programmatically. Suppose one of my .m3U contains the following entry:
z:\wrong-folder\Michael Jackson - Thriller.mp3
The file is stored in:
G:\my-collection-of-mp3\any-folder\Michael Jackson - Thriller.mp3
The goal is to update the wrong path with the right one :)
I have to create a collection of all my mp3 (around 6000 files) and their path. As I said, I have hundreds of .mu3 ; each .m3u has 15-20 entries. I have to check each entry against my 6000-entries-collection until the name matches. Well it is a plethora of loops :)
To ease the process I would create an ordered dictionary of dictionary whose the key would be the first letter of the name i.e. "M" (for Michael Jackson - Thriller.mp3) and the sub dictionary would be:
- key: Michael Jackson - Thriller.mp3
- value: G:\my-collection-of-mp3\any-folder\Michael Jackson - Thriller.mp3
Doing so I would only to iterate over a subset of the collection (looking up for the first letter of the name) instead of iterating over the whole non ordered collection.
A / Albert Jones - Song 1.mp3 -> G:\my-collection-of-mp3\any-folder\Albert Jones - Song 1.mp3
M / Madonna - Song 1.mp3 -> D:\somewhere-else\Madonna - Song 1.mp3
M / Michael Jackson - Thriller -> G:\my-collection-of-mp3\any-folder\Michael Jackson - Thriller.mp3
Do you think it is ok? What else would you recommend?