Example #1
0
def main():
	filename = "IPLAY"

	with open(filename,'wb') as out:
		pickler = Pickler(out)

		music_loc = get_music_location()
		all_tags = find_tags(music_loc)

		for song in all_tags:
			pickler.dump(song)
		pickler.save()
Example #2
0
def write_song_db(music_loc, song_db_loc=None, write_attribs=True):
	if song_db_loc is None:
		song_db_loc = music_loc

	all_tags = _find_tags(music_loc)
	attrib_key_dict,attrib_dict = _get_tag_attribs(all_tags) if write_attribs else (None,None)
	save_path = path_join(song_db_loc,song_db_name)

	with open(save_path,'wb') as out:
		pickler = Pickler(out)
		
		pickler.dump(attrib_key_dict)
		pickler.dump(attrib_dict)
		for song in all_tags:
			pickler.dump(song)
	
	return all_tags,attrib_key_dict,attrib_dict,save_path