| 1 |
"""
|
| 2 |
A program for interacting with iTunes library xml file.
|
| 3 |
|
| 4 |
Created by Emanuel Borges
|
| 5 |
|
| 6 |
"""
|
| 7 |
|
| 8 |
import NinoGenTools, os
|
| 9 |
|
| 10 |
|
| 11 |
def dictOfSongPaths(contents):
|
| 12 |
""" pass the contents of a library.xml file and it will give you a dict of complete song paths"""
|
| 13 |
myDict = {}
|
| 14 |
counter = NinoGenTools.Counter()
|
| 15 |
for line in contents:
|
| 16 |
line = line.strip()
|
| 17 |
if "Location" in line:
|
| 18 |
line = line.split("<string>")[1]
|
| 19 |
line = line.replace("</string>","")
|
| 20 |
myDict[counter.count] = line
|
| 21 |
counter.inc()
|
| 22 |
return myDict
|
| 23 |
|
| 24 |
def ListOfDups(myDict):
|
| 25 |
pass
|
| 26 |
|
| 27 |
def ListMissingAlbumArt(myDict):
|
| 28 |
pass
|
| 29 |
|
| 30 |
|
| 31 |
if __name__ == '__main__':
|
| 32 |
libFile = r"c:\client\library.xml"
|
| 33 |
contents = open(libFile).readlines()
|
| 34 |
|