mirror of
https://github.com/bspeice/Melodia
synced 2025-07-06 00:14:44 -04:00
Optimize scanning further, make song URL's PK
The Primary Key is added because these URL's must be unique anyway - you can't have two filenames point to different files. Additionally, this ensures that the database doesn't have multiple copies of a song.
This commit is contained in:
@ -47,7 +47,7 @@ class Song (models.Model):
|
||||
bit_rate = models.IntegerField(default = _default_bit_rate)
|
||||
duration = models.IntegerField(default = _default_bit_rate)
|
||||
echonest_song_id = models.CharField(max_length = 64, default = _default_echonest_song_id)
|
||||
url = models.CharField(max_length = 64)
|
||||
url = models.CharField(max_length = 255, primary_key = True)
|
||||
file_hash = melodia_settings.HASH_RESULT_DB_TYPE
|
||||
|
||||
def populate_metadata(self, use_echonest = False):
|
||||
|
Reference in New Issue
Block a user