Compare commits

...

4 Commits

114 changed files with 65 additions and 66 deletions

View File

@ -1,7 +1,7 @@
FROM alpine:latest
ENV TARGET=/opt/polyphonic
ENV RELEASE=polyphonic-0.8.3-py3-none-any.whl
ENV RELEASE=polyphonic-0.8.4-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.wsgi"]
CMD ["gunicorn", "-b", "0.0.0.0", "polyphonic.config.wsgi"]

View File

@ -2,13 +2,13 @@ PYTHON=env/bin/python
DROPZONE=5.7.0
test:
poetry run coverage run --include "app/*" --omit "*/migrations/*" app/manage.py test app
poetry run coverage run --include "polyphonic/*" --omit "*/migrations/*" polyphonic/manage.py test polyphonic
poetry run coverage html
poetry run coverage report
check:
poetry run ruff check app
poetry run ruff format --check app || true
poetry run ruff check polyphonic
poetry run ruff format --check polyphonic
pre-commit: check test

View File

@ -1,6 +1,6 @@
services:
polyphonic:
image: "polyphonic:latest"
image: "polyphonic:0.8.4"
build: "."
ports:
- "8001:8000"

View File

@ -11,6 +11,6 @@ import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'polyphonic.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.settings")
application = get_asgi_application()

View File

@ -29,11 +29,11 @@ SECRET_KEY = os.environ.get("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ["localhost"]
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
# Application definition
POLYPHONIC_MODULES = ["library"]
POLYPHONIC_MODULES = ["polyphonic.library"]
INSTALLED_APPS = [
"django.contrib.admin",
@ -47,7 +47,7 @@ INSTALLED_APPS = [
"crispy_forms",
"crispy_bulma",
"byostorage",
"interface",
"polyphonic.interface",
]
INSTALLED_APPS += POLYPHONIC_MODULES
@ -65,7 +65,7 @@ MIDDLEWARE = [
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
ROOT_URLCONF = "polyphonic.urls"
ROOT_URLCONF = "polyphonic.config.urls"
TEMPLATES = [
{
@ -83,7 +83,7 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = "polyphonic.wsgi.application"
WSGI_APPLICATION = "polyphonic.config.wsgi.application"
# Database
@ -139,4 +139,4 @@ STATIC_ROOT = "static"
CACHED_STORAGE_REMOTE = "byostorage.user.BYOStorage"
CACHED_STORAGE_DIR = os.path.join(WORK_DIR, "cache")
WHOOSH_INDEX = os.path.join(WORK_DIR, "index")
STORAGE_CLASSES = ["library.gdrive.storage.GDriveLinkStorage"]
STORAGE_CLASSES = ["polyphonic.library.gdrive.storage.GDriveLinkStorage"]

View File

@ -19,9 +19,9 @@ from django.urls import path, include
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("interface.urls")),
path("", include("polyphonic.interface.urls")),
# path('', include('submissions.urls')),
path("", include("library.urls")),
path("", include("polyphonic.library.urls")),
]
try:

View File

@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'polyphonic.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.config.settings.base")
application = get_wsgi_application()

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class InterfaceConfig(AppConfig):
name = "interface"
name = "polyphonic.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 interface.models
import polyphonic.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=interface.models.generate_code, help_text='Ensemble registration code', max_length=9)),
('code', models.CharField(default=polyphonic.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=interface.models.resource_key)),
('file', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.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 interface import models
from polyphonic.interface import models
from django.contrib.auth.models import User
from django.utils import timezone
from datetime import timedelta

View File

@ -1,5 +1,4 @@
from interface import models
from polyphonic.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 interface.utils import check_signed_url
from .utils import check_signed_url
import logging

View File

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

View File

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

View File

@ -1,4 +1,4 @@
from library.models import Collection, Work, WorkMeta, Document
from polyphonic.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 library.views import CollectionMixin
from library.models import Work, Document
from library import forms
from polyphonic.library.views import CollectionMixin
from polyphonic.library.models import Work, Document
from polyphonic.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 library.models import Work, Collection
from polyphonic.library.models import Work, Collection
instance = getattr(settings, "INDEXER", "library.indexer.whoosh")
instance = getattr(settings, "INDEXER", "polyphonic.library.indexer.whoosh")
class Indexer(Protocol):

View File

@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from library import models
from library.indexer import model_search, index_works, indexer
from polyphonic.library import models
from polyphonic.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 library.models import Work, Collection
from library.gdrive import sync_work, sync_collection
from polyphonic.library.models import Work, Collection
from polyphonic.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 library.models
import polyphonic.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=library.models.doc_upload_filename)),
('upload', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.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 library.models
import polyphonic.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=library.models.doc_upload_filename),
field=models.FileField(storage=byostorage.cached.CachedStorage(byostorage.user.BYOStorage()), upload_to=polyphonic.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 library.music_tags import MusicTag, auto_tag
from interface.utils import sign_data
from polyphonic.library.music_tags import MusicTag, auto_tag
from polyphonic.interface.utils import sign_data
import logging

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