--- /dev/null
+# Generated by Django 3.1.2 on 2021-06-25 16:19
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archive', '0022_auto_20210316_1406'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='project',
+ name='info_flac',
+ field=models.FileField(blank=True, upload_to='archive/info_flac'),
+ ),
+ ]
description = models.TextField(blank=True, verbose_name="Opis")
youtube = models.ForeignKey('youtube.YouTube', models.PROTECT)
icon = models.FileField(upload_to='archive/project', blank=True, null=True)
+ info_flac = models.FileField(upload_to='archive/info_flac', blank=True)
class Meta:
verbose_name = _("project")
def get_source_file_paths(self, audiobook):
if not audiobook.youtube_volume:
- return [audiobook.source_file.path]
- return [
- a.source_file.path
- for a in type(audiobook)
- .objects.filter(
- slug=audiobook.slug, youtube_volume=audiobook.youtube_volume
- )
- .order_by("index")
- ]
+ paths = [audiobook.source_file.path]
+ else:
+ paths = [
+ a.source_file.path
+ for a in type(audiobook)
+ .objects.filter(
+ slug=audiobook.slug, youtube_volume=audiobook.youtube_volume
+ )
+ .order_by("index")
+ ]
+ if audiobook.project.info_flac:
+ paths.append(audiobook.project.info_flac.path)
+ return paths