コード例 #1
0
def add_song_to_library(file_path):
    """
	Adds the specified song to the Song library.

	file_path: (str) Just the filename (with path).
	"""
    print "Importing", file_path
    # Once the Song is created and saved, ID3 tags will be pulled automatically.
    new_song = Song(local_path=file_path)
    new_song.save()
コード例 #2
0
def add_song_to_library(file_path):
    """
	Adds the specified song to the Song library.

	file_path: (str) Just the filename (with path).
	"""
    print "Importing", file_path
    # Once the Song is created and saved, ID3 tags will be pulled automatically.
    new_song = Song(local_path=file_path)
    new_song.save()
コード例 #3
0
def add_song_to_library(file_name):
    """
    Adds the specified song to the Song library.
    
    file_name: (str) Just the filename (without path).
    """
    print "Importing", file_name
    # Add on the 'music' prefix in the path.
    file_path = os.path.join(settings.MUSIC_DIR_NAME, file_name)
    # Once the Song is created and saved, ID3 tags will be pulled automatically.
    new_song = Song(file=file_path)
    new_song.save()