From d18722a18cd265ee6b650f83b9cca9f13e3d5cde Mon Sep 17 00:00:00 2001 From: Erik Hahn Date: Thu, 30 Jul 2009 18:21:48 +0200 Subject: [PATCH] Add WIP --- ordnung.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ordnung.py diff --git a/ordnung.py b/ordnung.py new file mode 100644 index 0000000..158d230 --- /dev/null +++ b/ordnung.py @@ -0,0 +1,34 @@ +from path import path +import fnmatch +import os + +from mutagen.oggvorbis import OggVorbis + +ACCEPTEXTS = [".ogg"] # Keep it simple for now + +def issupportedfile(name): + for ext in ACCEPTEXTS: + if os.path.splitext(name)[1] == ext: + return True + return False + +def main(): + ## Handle arguments (TODO) + # This will probably the default later one, at least until I + # implement %album artist% + pattern = "%base%/%artist%/%album%/%title%.%ext%" + base = "D:/Eigene Musik" + + basepath = path(base) + for filepath in basepath.walkfiles(): + if issupportedfile(filepath): + print filepath + try: + audio = OggVorbis(filepath) + except: #TODO + print "empty" + else: + print audio["title"] + +if __name__ == "__main__": + main() -- 2.11.4.GIT