diff --git a/config/root/etc/nginx/nginx.conf b/config/root/etc/nginx/nginx.conf index 4cddd7b..14c5aea 100644 --- a/config/root/etc/nginx/nginx.conf +++ b/config/root/etc/nginx/nginx.conf @@ -79,6 +79,11 @@ http { proxy_connect_timeout 10; } + # File dwnload and streaming + location /media-data/ { + internal; + alias /downloads/; + } } } diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 4e42086..59ce225 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -21,7 +21,7 @@ from .matching import (get_best_combined_format, get_best_audio_format, from .mediaservers import PlexMediaServer -media_file_storage = FileSystemStorage(location=str(settings.DOWNLOAD_ROOT)) +media_file_storage = FileSystemStorage(location=str(settings.DOWNLOAD_ROOT), base_url='/media-data/') class Source(models.Model): diff --git a/tubesync/sync/templates/sync/media-item.html b/tubesync/sync/templates/sync/media-item.html index 62f6f35..868b1c1 100644 --- a/tubesync/sync/templates/sync/media-item.html +++ b/tubesync/sync/templates/sync/media-item.html @@ -9,6 +9,12 @@ {% if media.title %}
Downloading to: {{ media.source.directory_path }}
+ {% if download_state == 'downloaded' %} + + + {% endif %} {% if not media.can_download %}{% include 'errorbox.html' with message='Media cannot be downloaded because it has no formats which match the source requirements.' %}{% endif %} diff --git a/tubesync/sync/urls.py b/tubesync/sync/urls.py index 9632c3c..bfe73b7 100644 --- a/tubesync/sync/urls.py +++ b/tubesync/sync/urls.py @@ -2,7 +2,7 @@ from django.urls import path from .views import (DashboardView, SourcesView, ValidateSourceView, AddSourceView, SourceView, UpdateSourceView, DeleteSourceView, MediaView, MediaThumbView, MediaItemView, MediaRedownloadView, MediaSkipView, - MediaEnableView, TasksView, CompletedTasksView, ResetTasks, + MediaEnableView, MediaContent, TasksView, CompletedTasksView, ResetTasks, MediaServersView, AddMediaServerView, MediaServerView, DeleteMediaServerView, UpdateMediaServerView) @@ -70,6 +70,10 @@ urlpatterns = [ MediaEnableView.as_view(), name='enable-media'), + path('media-content/