예제 #1
0
    bin.connect("error", error_cb)
    
    bin.set_state(gst.STATE_PAUSED)
    
    res = bin.set_state(gst.STATE_PLAYING);
    while bin.iterate():
        pass
    print "Done.\n"
    
if __name__ == "__main__":
    import gnosis.xml.pickle    
    tag = Tag()
    root = "/mnt/flac/"
    if sys.argv:
    	root = sys.argv[1]
    for root, dirs, files in walk(root, followlinks=True):
        mp3dir = root.replace("/flac/", "/mp3/")
        if not os.path.exists(mp3dir):
            os.makedirs(mp3dir)

        discmetafile = os.path.join(root, "discmetadata.xml")

        if not os.path.exists(discmetafile):
            continue
        else:
            f = open(discmetafile, "r")
            xml = f.read()
            discMeta = gnosis.xml.pickle.loads(xml)
            f.close()

        print "\n---------------------"
예제 #2
0
import os,sys
from Util import walk

if __name__ == "__main__":
    root = "/mnt/tera/flac/"
    if sys.argv:
    	root = sys.argv[1]
    for root, dirs, files in walk(root, followlinks=True):
        mp3dir = root.replace("/flac/", "/mp3/")
        print (root)
        
        coverfilename = os.path.join(root, "cover.jpg")

        tracknums = {}
        for file in files:
            if file.endswith(".flac") or file.endswith(".mp3"):
                if file[0] in "0123456789":
                    tracknum = int(file[:2])
                    if tracknum in tracknums:
                        print "***DUPLICATE TRACKNUM %d!\n%s\n%s\n" % (tracknum, tracknums[tracknum], file)
                    else:
                        tracknums[tracknum] = file
            elif file not in ["cover.jpg", "discmetadata.xml", "discmetadata.xml.bak"]:
                print "***WEIRD FILE!\n%s\n" % file

        if tracknums and max(tracknums.keys()) > len(tracknums.keys()):
            print "***FOUND %d FILES, MAXTRACKNUM %d\n" % (len(tracknums.keys()), max(tracknums.keys()))
        if not tracknums and not dirs:
            print "***NO MUSIC FILES FOUND AND NO SUBDIRS\n"
예제 #3
0
import os,sys
from data.MusicBrainz import *
from data.DiscMetadata import *
from Util import walk

if __name__ == "__main__":
    import gnosis.xml.pickle    
    for root, dirs, files in walk("/mnt/tera/flac/Supergrass",followlinks=True):
        discmetafile = os.path.join(root, "discmetadata.xml")

        if os.path.exists(discmetafile):
            f = open(discmetafile, "r")
            xml = f.read()
            discmeta = gnosis.xml.pickle.loads(xml)
            f.close()
        else:
            continue
            
        print "\n\n======================================"
        print ("Checking %s - %s" % (discmeta.artist, discmeta.title)).encode("ascii", "ignore")

	try:
	    mb = searchMbByDiscId(discmeta.mbAlbumId)
	except:
	    print "***** MB SEARCH FAILED *****"
	    sys.stdout.flush()
	    continue
        
        if not mb:
            print "***** DISC ID NO LONGER VALID FOR: '%s' *****" % discmeta.title
	    sys.stdout.flush()
예제 #4
0
import os, sys
from data.MusicBrainz import *
from data.DiscMetadata import *
from Util import walk

if __name__ == "__main__":
    import gnosis.xml.pickle
    for root, dirs, files in walk("/mnt/tera/flac/Supergrass",
                                  followlinks=True):
        discmetafile = os.path.join(root, "discmetadata.xml")

        if os.path.exists(discmetafile):
            f = open(discmetafile, "r")
            xml = f.read()
            discmeta = gnosis.xml.pickle.loads(xml)
            f.close()
        else:
            continue

        print "\n\n======================================"
        print("Checking %s - %s" % (discmeta.artist, discmeta.title)).encode(
            "ascii", "ignore")

        try:
            mb = searchMbByDiscId(discmeta.mbAlbumId)
        except:
            print "***** MB SEARCH FAILED *****"
            sys.stdout.flush()
            continue

        if not mb:
예제 #5
0
#!/usr/bin/python
import os
from Util import walk

for root, dirs, files in walk("/mnt/mp3/non-flac/mbtagged"):  #flac"):
    if not os.path.exists(os.path.join(root, 'cover.jpg')):
        if (os.path.split(root))[0] <> '/mnt/mp3/non-flac/mbtagged':
            print root
예제 #6
0
#!/usr/bin/python
import os
from Util import walk

for root, dirs, files in walk("/mnt/mp3/non-flac/mbtagged"):#flac"):
	if not os.path.exists(os.path.join(root, 'cover.jpg')):
		if (os.path.split(root))[0] <> '/mnt/mp3/non-flac/mbtagged':
			print root