mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 19:52:20 +01:00
replaygain: Prepare song model for rg retrieval
This commit is contained in:
@ -8,7 +8,9 @@ def song_to_dict(song, hash=False, user=False):
|
||||
'id': song.id,
|
||||
'artist': song.artist,
|
||||
'title': song.title,
|
||||
'duration': song.duration
|
||||
'duration': song.duration,
|
||||
'rg_gain': song.rg_gain,
|
||||
'rg_peak': song.rg_peak,
|
||||
}
|
||||
|
||||
if hash:
|
||||
|
||||
30
marietje/songs/migrations/0002_replaygain.py
Normal file
30
marietje/songs/migrations/0002_replaygain.py
Normal file
@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.5 on 2017-09-18 12:14
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('songs', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='song',
|
||||
name='rg_gain',
|
||||
field=models.DecimalField(blank=True, decimal_places=6, help_text='replaygain gain level', max_digits=9, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='song',
|
||||
name='rg_peak',
|
||||
field=models.DecimalField(blank=True, decimal_places=6, help_text='replaygain peak level', max_digits=9, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='song',
|
||||
name='duration',
|
||||
field=models.IntegerField(help_text='track duration in seconds'),
|
||||
),
|
||||
]
|
||||
@ -12,7 +12,11 @@ class Song(models.Model):
|
||||
artist = models.TextField()
|
||||
title = models.TextField()
|
||||
hash = models.TextField()
|
||||
duration = models.IntegerField()
|
||||
duration = models.IntegerField(help_text="track duration in seconds")
|
||||
rg_gain = models.DecimalField(max_digits=9, decimal_places=6,
|
||||
blank=True, null=True, help_text="replaygain gain level")
|
||||
rg_peak = models.DecimalField(max_digits=9, decimal_places=6,
|
||||
blank=True, null=True, help_text="replaygain peak level")
|
||||
old_id = models.TextField(blank=True, null=True, default=None)
|
||||
deleted = models.BooleanField(default=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user