Compare commits
No commits in common. "4cef5800bc66a6a285dfb317fcd2b674f8d40488" and "ff171145141b226f1bdcf6d87c2db470d191d5ca" have entirely different histories.
4cef5800bc
...
ff17114514
@ -1,7 +1,7 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
ENV TARGET=/opt/polyphonic
|
ENV TARGET=/opt/polyphonic
|
||||||
ENV RELEASE=polyphonic-0.8.4-py3-none-any.whl
|
ENV RELEASE=polyphonic-0.8.3-py3-none-any.whl
|
||||||
|
|
||||||
RUN apk add --no-cache python3 py3-pip git ghostscript sqlite
|
RUN apk add --no-cache python3 py3-pip git ghostscript sqlite
|
||||||
|
|
||||||
@ -21,4 +21,4 @@ RUN SECRET_KEY=_ poly-tool collectstatic --noinput
|
|||||||
VOLUME ["/var/polyphonic"]
|
VOLUME ["/var/polyphonic"]
|
||||||
EXPOSE 8000/tcp
|
EXPOSE 8000/tcp
|
||||||
|
|
||||||
CMD ["gunicorn", "-b", "0.0.0.0", "polyphonic.config.wsgi"]
|
CMD ["gunicorn", "-b", "0.0.0.0", "polyphonic.wsgi"]
|
||||||
|
|||||||
6
Makefile
6
Makefile
@ -2,13 +2,13 @@ PYTHON=env/bin/python
|
|||||||
DROPZONE=5.7.0
|
DROPZONE=5.7.0
|
||||||
|
|
||||||
test:
|
test:
|
||||||
poetry run coverage run --include "polyphonic/*" --omit "*/migrations/*" polyphonic/manage.py test polyphonic
|
poetry run coverage run --include "app/*" --omit "*/migrations/*" app/manage.py test app
|
||||||
poetry run coverage html
|
poetry run coverage html
|
||||||
poetry run coverage report
|
poetry run coverage report
|
||||||
|
|
||||||
check:
|
check:
|
||||||
poetry run ruff check polyphonic
|
poetry run ruff check app
|
||||||
poetry run ruff format --check polyphonic
|
poetry run ruff format --check app || true
|
||||||
|
|
||||||
pre-commit: check test
|
pre-commit: check test
|
||||||
|
|
||||||
|
|||||||
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
|
|
||||||
class InterfaceConfig(AppConfig):
|
class InterfaceConfig(AppConfig):
|
||||||
name = "polyphonic.interface"
|
name = "interface"
|
||||||
@ -4,7 +4,7 @@ import byostorage.user
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import polyphonic.interface.models
|
import interface.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -23,7 +23,7 @@ class Migration(migrations.Migration):
|
|||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(help_text='Display name', max_length=100)),
|
('name', models.CharField(help_text='Display name', max_length=100)),
|
||||||
('slug', models.SlugField(editable=False, help_text='Short name for the ensemble - used for folders', max_length=100, unique=True)),
|
('slug', models.SlugField(editable=False, help_text='Short name for the ensemble - used for folders', max_length=100, unique=True)),
|
||||||
('code', models.CharField(default=polyphonic.interface.models.generate_code, help_text='Ensemble registration code', max_length=9)),
|
('code', models.CharField(default=interface.models.generate_code, help_text='Ensemble registration code', max_length=9)),
|
||||||
('passphrase', models.CharField(help_text='Used to register ensembles', max_length=100)),
|
('passphrase', models.CharField(help_text='Used to register ensembles', max_length=100)),
|
||||||
('details', models.TextField(blank=True, help_text='Description of the ensemble (markdown)')),
|
('details', models.TextField(blank=True, help_text='Description of the ensemble (markdown)')),
|
||||||
('admins', models.ManyToManyField(related_name='ensembles', to=settings.AUTH_USER_MODEL)),
|
('admins', models.ManyToManyField(related_name='ensembles', to=settings.AUTH_USER_MODEL)),
|
||||||
@ -60,7 +60,7 @@ class Migration(migrations.Migration):
|
|||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=100)),
|
('name', models.CharField(max_length=100)),
|
||||||
('description', models.TextField(blank=True)),
|
('description', models.TextField(blank=True)),
|
||||||
('file', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.interface.models.resource_key)),
|
('file', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=interface.models.resource_key)),
|
||||||
('media_type', models.CharField(choices=[('audio', 'Audio'), ('video', 'Video'), ('general', 'General')], default='*', max_length=10)),
|
('media_type', models.CharField(choices=[('audio', 'Audio'), ('video', 'Video'), ('general', 'General')], default='*', max_length=10)),
|
||||||
('visible', models.BooleanField(default=True)),
|
('visible', models.BooleanField(default=True)),
|
||||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='interface.project')),
|
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='interface.project')),
|
||||||
|
Before Width: | Height: | Size: 426 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
@ -1,5 +1,5 @@
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from polyphonic.interface import models
|
from interface import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
@ -1,4 +1,5 @@
|
|||||||
from polyphonic.interface import models
|
|
||||||
|
from interface import models
|
||||||
|
|
||||||
from . import AccessTestCase
|
from . import AccessTestCase
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ from django.contrib.auth import logout
|
|||||||
from markdown2 import markdown
|
from markdown2 import markdown
|
||||||
|
|
||||||
from . import models, forms
|
from . import models, forms
|
||||||
from .utils import check_signed_url
|
from interface.utils import check_signed_url
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
|
|
||||||
class LibraryConfig(AppConfig):
|
class LibraryConfig(AppConfig):
|
||||||
name = "polyphonic.library"
|
name = "library"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from .models import Work
|
from .models import Work
|
||||||
from polyphonic.interface.models import Project
|
from interface.models import Project
|
||||||
from polyphonic.interface.forms import BaseForm
|
from interface.forms import BaseForm
|
||||||
|
|
||||||
|
|
||||||
class WorkCreateForm(forms.ModelForm, BaseForm):
|
class WorkCreateForm(forms.ModelForm, BaseForm):
|
||||||
@ -1,4 +1,4 @@
|
|||||||
from polyphonic.library.models import Collection, Work, WorkMeta, Document
|
from library.models import Collection, Work, WorkMeta, Document
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
from django.shortcuts import resolve_url, redirect
|
from django.shortcuts import resolve_url, redirect
|
||||||
from django.views.generic import FormView
|
from django.views.generic import FormView
|
||||||
from django.views.generic.detail import SingleObjectMixin
|
from django.views.generic.detail import SingleObjectMixin
|
||||||
from polyphonic.library.views import CollectionMixin
|
from library.views import CollectionMixin
|
||||||
from polyphonic.library.models import Work, Document
|
from library.models import Work, Document
|
||||||
from polyphonic.library import forms
|
from library import forms
|
||||||
|
|
||||||
|
|
||||||
class WorkGDriveView(CollectionMixin, SingleObjectMixin, FormView):
|
class WorkGDriveView(CollectionMixin, SingleObjectMixin, FormView):
|
||||||
@ -3,9 +3,9 @@ from django.conf import settings
|
|||||||
from django.utils.module_loading import import_module
|
from django.utils.module_loading import import_module
|
||||||
from django.db.models import QuerySet
|
from django.db.models import QuerySet
|
||||||
|
|
||||||
from polyphonic.library.models import Work, Collection
|
from library.models import Work, Collection
|
||||||
|
|
||||||
instance = getattr(settings, "INDEXER", "polyphonic.library.indexer.whoosh")
|
instance = getattr(settings, "INDEXER", "library.indexer.whoosh")
|
||||||
|
|
||||||
|
|
||||||
class Indexer(Protocol):
|
class Indexer(Protocol):
|
||||||
@ -1,7 +1,7 @@
|
|||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from polyphonic.library import models
|
from library import models
|
||||||
from polyphonic.library.indexer import model_search, index_works, indexer
|
from library.indexer import model_search, index_works, indexer
|
||||||
|
|
||||||
FORMATTER = "{w.name:50s} {w.edition:15s} {w.collection.name:15s}"
|
FORMATTER = "{w.name:50s} {w.edition:15s} {w.collection.name:15s}"
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
from polyphonic.library.models import Work, Collection
|
from library.models import Work, Collection
|
||||||
from polyphonic.library.gdrive import sync_work, sync_collection
|
from library.gdrive import sync_work, sync_collection
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -4,7 +4,7 @@ import byostorage.user
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import polyphonic.library.models
|
import library.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('doctype', models.PositiveSmallIntegerField(choices=[(1, 'PDF'), (2, 'Audio'), (3, 'Video'), (4, 'Source')], default=1)),
|
('doctype', models.PositiveSmallIntegerField(choices=[(1, 'PDF'), (2, 'Audio'), (3, 'Video'), (4, 'Source')], default=1)),
|
||||||
('upload', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.library.models.doc_upload_filename)),
|
('upload', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=library.models.doc_upload_filename)),
|
||||||
('created', models.DateTimeField(auto_now_add=True)),
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
('version', models.CharField(blank=True, max_length=30)),
|
('version', models.CharField(blank=True, max_length=30)),
|
||||||
],
|
],
|
||||||
@ -3,7 +3,7 @@
|
|||||||
import byostorage.cached
|
import byostorage.cached
|
||||||
import byostorage.user
|
import byostorage.user
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import polyphonic.library.models
|
import library.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -26,7 +26,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='document',
|
model_name='document',
|
||||||
name='upload',
|
name='upload',
|
||||||
field=models.FileField(storage=byostorage.cached.CachedStorage(byostorage.user.BYOStorage()), upload_to=polyphonic.library.models.doc_upload_filename),
|
field=models.FileField(storage=byostorage.cached.CachedStorage(byostorage.user.BYOStorage()), upload_to=library.models.doc_upload_filename),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='work',
|
model_name='work',
|
||||||
@ -11,8 +11,8 @@ import os.path
|
|||||||
from byostorage.user import BYOStorage
|
from byostorage.user import BYOStorage
|
||||||
from byostorage.cached import CachedStorage
|
from byostorage.cached import CachedStorage
|
||||||
|
|
||||||
from polyphonic.library.music_tags import MusicTag, auto_tag
|
from library.music_tags import MusicTag, auto_tag
|
||||||
from polyphonic.interface.utils import sign_data
|
from interface.utils import sign_data
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
from polyphonic.library.models import Collection, Work
|
from library.models import Collection, Work
|
||||||
from polyphonic.library.indexer import index_works, model_search
|
from library.indexer import index_works, model_search
|
||||||
from polyphonic.library.indexer import whoosh
|
from library.indexer import whoosh
|
||||||
|
|
||||||
JAZZ_STANDARDS = (
|
JAZZ_STANDARDS = (
|
||||||
["But Not For Me", "Gershwin, George & Ira"],
|
["But Not For Me", "Gershwin, George & Ira"],
|
||||||
@ -1,7 +1,7 @@
|
|||||||
from polyphonic.interface.tests import AccessTestCase
|
from interface.tests import AccessTestCase
|
||||||
|
|
||||||
from byostorage.user import UserStorage
|
from byostorage.user import UserStorage
|
||||||
from polyphonic.library import models
|
from library import models
|
||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import json
|
import json
|
||||||
@ -3,7 +3,7 @@ from django.urls import path
|
|||||||
from . import views
|
from . import views
|
||||||
from .gdrive import views as gdrive_views
|
from .gdrive import views as gdrive_views
|
||||||
|
|
||||||
from .views import api
|
from library.views import api
|
||||||
|
|
||||||
# router = routers.DefaultRouter()
|
# router = routers.DefaultRouter()
|
||||||
# router.register(r'collection', external.CollectionViewSet, basename="collection")
|
# router.register(r'collection', external.CollectionViewSet, basename="collection")
|
||||||
@ -17,13 +17,13 @@ import json
|
|||||||
import os.path
|
import os.path
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from polyphonic.interface.views import ProjectMixin, AuthorizedResourceMixin
|
from interface.views import ProjectMixin, AuthorizedResourceMixin
|
||||||
from polyphonic.interface.utils import signed_url
|
from interface.utils import signed_url
|
||||||
from polyphonic.library.models import Collection, Work, Document, Section
|
from library.models import Collection, Work, Document, Section
|
||||||
from polyphonic.library.music_tags import MUSIC_TAGS, MusicTag
|
from library.music_tags import MUSIC_TAGS, MusicTag
|
||||||
from polyphonic.library import forms, models
|
from library import forms, models
|
||||||
from polyphonic.library.pdf_utils import extract_pages, extract_and_concat
|
from library.pdf_utils import extract_pages, extract_and_concat
|
||||||
from polyphonic.library.indexer import indexer, model_search
|
from library.indexer import indexer, model_search
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user