Compare commits

..

No commits in common. "4cef5800bc66a6a285dfb317fcd2b674f8d40488" and "ff171145141b226f1bdcf6d87c2db470d191d5ca" have entirely different histories.

114 changed files with 66 additions and 65 deletions

View File

@ -1,7 +1,7 @@
FROM alpine:latest
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
@ -21,4 +21,4 @@ RUN SECRET_KEY=_ poly-tool collectstatic --noinput
VOLUME ["/var/polyphonic"]
EXPOSE 8000/tcp
CMD ["gunicorn", "-b", "0.0.0.0", "polyphonic.config.wsgi"]
CMD ["gunicorn", "-b", "0.0.0.0", "polyphonic.wsgi"]

View File

@ -2,13 +2,13 @@ PYTHON=env/bin/python
DROPZONE=5.7.0
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 report
check:
poetry run ruff check polyphonic
poetry run ruff format --check polyphonic
poetry run ruff check app
poetry run ruff format --check app || true
pre-commit: check test

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class InterfaceConfig(AppConfig):
name = "polyphonic.interface"
name = "interface"

View File

@ -4,7 +4,7 @@ import byostorage.user
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import polyphonic.interface.models
import interface.models
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')),
('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)),
('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)),
('details', models.TextField(blank=True, help_text='Description of the ensemble (markdown)')),
('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')),
('name', models.CharField(max_length=100)),
('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)),
('visible', models.BooleanField(default=True)),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='interface.project')),

View File

Before

Width:  |  Height:  |  Size: 426 KiB

After

Width:  |  Height:  |  Size: 426 KiB

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View File

@ -1,5 +1,5 @@
from django.test import TestCase
from polyphonic.interface import models
from interface import models
from django.contrib.auth.models import User
from django.utils import timezone
from datetime import timedelta

View File

@ -1,4 +1,5 @@
from polyphonic.interface import models
from interface import models
from . import AccessTestCase

View File

@ -15,7 +15,7 @@ from django.contrib.auth import logout
from markdown2 import markdown
from . import models, forms
from .utils import check_signed_url
from interface.utils import check_signed_url
import logging

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class LibraryConfig(AppConfig):
name = "polyphonic.library"
name = "library"

View File

@ -1,7 +1,7 @@
from django import forms
from .models import Work
from polyphonic.interface.models import Project
from polyphonic.interface.forms import BaseForm
from interface.models import Project
from interface.forms import BaseForm
class WorkCreateForm(forms.ModelForm, BaseForm):

View File

@ -1,4 +1,4 @@
from polyphonic.library.models import Collection, Work, WorkMeta, Document
from library.models import Collection, Work, WorkMeta, Document
import logging

View File

@ -1,9 +1,9 @@
from django.shortcuts import resolve_url, redirect
from django.views.generic import FormView
from django.views.generic.detail import SingleObjectMixin
from polyphonic.library.views import CollectionMixin
from polyphonic.library.models import Work, Document
from polyphonic.library import forms
from library.views import CollectionMixin
from library.models import Work, Document
from library import forms
class WorkGDriveView(CollectionMixin, SingleObjectMixin, FormView):

View File

@ -3,9 +3,9 @@ from django.conf import settings
from django.utils.module_loading import import_module
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):

View File

@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from polyphonic.library import models
from polyphonic.library.indexer import model_search, index_works, indexer
from library import models
from library.indexer import model_search, index_works, indexer
FORMATTER = "{w.name:50s} {w.edition:15s} {w.collection.name:15s}"

View File

@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand, CommandError
from polyphonic.library.models import Work, Collection
from polyphonic.library.gdrive import sync_work, sync_collection
from library.models import Work, Collection
from library.gdrive import sync_work, sync_collection
class Command(BaseCommand):

View File

@ -4,7 +4,7 @@ import byostorage.user
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import polyphonic.library.models
import library.models
class Migration(migrations.Migration):
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
fields=[
('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)),
('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)),
('version', models.CharField(blank=True, max_length=30)),
],

View File

@ -3,7 +3,7 @@
import byostorage.cached
import byostorage.user
from django.db import migrations, models
import polyphonic.library.models
import library.models
class Migration(migrations.Migration):
@ -26,7 +26,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='document',
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(
model_name='work',

View File

@ -11,8 +11,8 @@ import os.path
from byostorage.user import BYOStorage
from byostorage.cached import CachedStorage
from polyphonic.library.music_tags import MusicTag, auto_tag
from polyphonic.interface.utils import sign_data
from library.music_tags import MusicTag, auto_tag
from interface.utils import sign_data
import logging

View File

@ -1,9 +1,9 @@
from django.test import TestCase
from tempfile import TemporaryDirectory
from polyphonic.library.models import Collection, Work
from polyphonic.library.indexer import index_works, model_search
from polyphonic.library.indexer import whoosh
from library.models import Collection, Work
from library.indexer import index_works, model_search
from library.indexer import whoosh
JAZZ_STANDARDS = (
["But Not For Me", "Gershwin, George & Ira"],

View File

@ -1,7 +1,7 @@
from polyphonic.interface.tests import AccessTestCase
from interface.tests import AccessTestCase
from byostorage.user import UserStorage
from polyphonic.library import models
from library import models
import tempfile
import json

View File

@ -3,7 +3,7 @@ from django.urls import path
from . import views
from .gdrive import views as gdrive_views
from .views import api
from library.views import api
# router = routers.DefaultRouter()
# router.register(r'collection', external.CollectionViewSet, basename="collection")

View File

@ -17,13 +17,13 @@ import json
import os.path
import string
from polyphonic.interface.views import ProjectMixin, AuthorizedResourceMixin
from polyphonic.interface.utils import signed_url
from polyphonic.library.models import Collection, Work, Document, Section
from polyphonic.library.music_tags import MUSIC_TAGS, MusicTag
from polyphonic.library import forms, models
from polyphonic.library.pdf_utils import extract_pages, extract_and_concat
from polyphonic.library.indexer import indexer, model_search
from interface.views import ProjectMixin, AuthorizedResourceMixin
from interface.utils import signed_url
from library.models import Collection, Work, Document, Section
from library.music_tags import MUSIC_TAGS, MusicTag
from library import forms, models
from library.pdf_utils import extract_pages, extract_and_concat
from library.indexer import indexer, model_search
import logging

Some files were not shown because too many files have changed in this diff Show More