From 281e37178bdd8094fda85a9a03dea597a5c0d5b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:54:20 +0000 Subject: [PATCH 1/4] Bump ytmusicapi from 0.25.2 to 1.0.2 Bumps [ytmusicapi](https://github.com/sigma67/ytmusicapi) from 0.25.2 to 1.0.2. - [Release notes](https://github.com/sigma67/ytmusicapi/releases) - [Commits](https://github.com/sigma67/ytmusicapi/compare/0.25.2...1.0.2) --- updated-dependencies: - dependency-name: ytmusicapi dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 9 +++++---- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 03cffa7..4a6b45a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3452,6 +3452,7 @@ files = [ {file = "Pillow-9.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c1170d6b195555644f0616fd6ed929dfcf6333b8675fcca044ae5ab110ded296"}, {file = "Pillow-9.5.0-cp311-cp311-win32.whl", hash = "sha256:54f7102ad31a3de5666827526e248c3530b3a33539dbda27c6843d19d72644ec"}, {file = "Pillow-9.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:cfa4561277f677ecf651e2b22dc43e8f5368b74a25a8f7d1d4a3a243e573f2d4"}, + {file = "Pillow-9.5.0-cp311-cp311-win_arm64.whl", hash = "sha256:965e4a05ef364e7b973dd17fc765f42233415974d773e82144c9bbaaaea5d089"}, {file = "Pillow-9.5.0-cp312-cp312-win32.whl", hash = "sha256:22baf0c3cf0c7f26e82d6e1adf118027afb325e703922c8dfc1d5d0156bb2eeb"}, {file = "Pillow-9.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:432b975c009cf649420615388561c0ce7cc31ce9b2e374db659ee4f7d57a1f8b"}, {file = "Pillow-9.5.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:5d4ebf8e1db4441a55c509c4baa7a0587a0210f7cd25fcfe74dbbce7a4bd1906"}, @@ -5630,14 +5631,14 @@ multidict = ">=4.0" [[package]] name = "ytmusicapi" -version = "0.25.2" +version = "1.0.2" description = "Unofficial API for YouTube Music" category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "ytmusicapi-0.25.2-py3-none-any.whl", hash = "sha256:3d47a8803dceeb0289c7cf29a0317c5d6051d0b7c28fda067f6abb001746f7ac"}, - {file = "ytmusicapi-0.25.2.tar.gz", hash = "sha256:aa3165100ff5c0e1f49f9a046312f878c31eea83fde14af0707e3368ae923fe4"}, + {file = "ytmusicapi-1.0.2-py3-none-any.whl", hash = "sha256:8e3f364dbb0d4e9bbbbcac65e65c2449e7e236478ecc00e6b5bc25455e488eee"}, + {file = "ytmusicapi-1.0.2.tar.gz", hash = "sha256:f798bfedd49738bece82aac15b2d97f04578ccb1572f347a350cb704df4d0e10"}, ] [package.dependencies] @@ -5697,4 +5698,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "c065bd831f46b58518895fa101821a580bebe3f7792348ca31d6a4fb4aab2b82" +content-hash = "cf3ed0fdbb3500255eff2babe87788a51df5c5a329ca23a0792f3c123a4a2742" diff --git a/pyproject.toml b/pyproject.toml index ab7abe2..4fcd824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ preview-generator = "^0.29" uuid = "^1.30" mutagen = "^1.46.0" pytube = "^12.1.3" -ytmusicapi = "^0.25.2" +ytmusicapi = "^1.0.2" pydub = "^0.25.1" python-mpd2 = "^3.0.5" yandex-music = "^2.0.1" From ff3d06662af47b34659e90e9d3eb56826fdfa51a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 15:17:48 +0000 Subject: [PATCH 2/4] Bump yandex-music from 2.0.1 to 2.1.0 Bumps [yandex-music](https://github.com/MarshalX/yandex-music-api) from 2.0.1 to 2.1.0. - [Release notes](https://github.com/MarshalX/yandex-music-api/releases) - [Changelog](https://github.com/MarshalX/yandex-music-api/blob/main/CHANGES.md) - [Commits](https://github.com/MarshalX/yandex-music-api/commits/v2.1.0) --- updated-dependencies: - dependency-name: yandex-music dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 7 ++++--- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 03cffa7..6eaa607 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3452,6 +3452,7 @@ files = [ {file = "Pillow-9.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c1170d6b195555644f0616fd6ed929dfcf6333b8675fcca044ae5ab110ded296"}, {file = "Pillow-9.5.0-cp311-cp311-win32.whl", hash = "sha256:54f7102ad31a3de5666827526e248c3530b3a33539dbda27c6843d19d72644ec"}, {file = "Pillow-9.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:cfa4561277f677ecf651e2b22dc43e8f5368b74a25a8f7d1d4a3a243e573f2d4"}, + {file = "Pillow-9.5.0-cp311-cp311-win_arm64.whl", hash = "sha256:965e4a05ef364e7b973dd17fc765f42233415974d773e82144c9bbaaaea5d089"}, {file = "Pillow-9.5.0-cp312-cp312-win32.whl", hash = "sha256:22baf0c3cf0c7f26e82d6e1adf118027afb325e703922c8dfc1d5d0156bb2eeb"}, {file = "Pillow-9.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:432b975c009cf649420615388561c0ce7cc31ce9b2e374db659ee4f7d57a1f8b"}, {file = "Pillow-9.5.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:5d4ebf8e1db4441a55c509c4baa7a0587a0210f7cd25fcfe74dbbce7a4bd1906"}, @@ -5526,13 +5527,13 @@ files = [ [[package]] name = "yandex-music" -version = "2.0.1" +version = "2.1.0" description = "Неофициальная Python библиотека для работы с API сервиса Яндекс.Музыка." category = "main" optional = false python-versions = "~=3.7" files = [ - {file = "yandex-music-2.0.1.tar.gz", hash = "sha256:d01f35d72aa0a6deca474566fff18109af7fcc8ef0377876e6c83da1ae096671"}, + {file = "yandex-music-2.1.0.tar.gz", hash = "sha256:6211e8ffe0bad8d79815578a1cd86ee45630784f93c5f5ec73bf2228b7ab27ba"}, ] [package.dependencies] @@ -5697,4 +5698,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "c065bd831f46b58518895fa101821a580bebe3f7792348ca31d6a4fb4aab2b82" +content-hash = "2338225a40b5062c7c14740799b6817a33a774d4676baac8609d950091cae084" diff --git a/pyproject.toml b/pyproject.toml index ab7abe2..5a6243b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ pytube = "^12.1.3" ytmusicapi = "^0.25.2" pydub = "^0.25.1" python-mpd2 = "^3.0.5" -yandex-music = "^2.0.1" +yandex-music = "^2.1.0" pyjwt = "^2.6.0" rawpy = "^0.18.0" xvfbwrapper = "^0.2.9" From 85ae29696eb409fb9542c5926333902621246d25 Mon Sep 17 00:00:00 2001 From: Alexander-D-Karpov Date: Tue, 25 Apr 2023 00:15:59 +0300 Subject: [PATCH 3/4] fixed file reports --- akarpov/files/admin.py | 4 +++- akarpov/files/views.py | 19 +++++++++---------- akarpov/templates/files/list.html | 10 +++++++--- akarpov/templates/files/reports.html | 2 ++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/akarpov/files/admin.py b/akarpov/files/admin.py index 5ea49d1..f9100ad 100644 --- a/akarpov/files/admin.py +++ b/akarpov/files/admin.py @@ -1,6 +1,8 @@ from django.contrib import admin -from akarpov.files.models import File, Folder +from akarpov.files.models import File, FileInTrash, FileReport, Folder admin.site.register(File) admin.site.register(Folder) +admin.site.register(FileInTrash) +admin.site.register(FileReport) diff --git a/akarpov/files/views.py b/akarpov/files/views.py index ea85c5e..0cfb2b5 100644 --- a/akarpov/files/views.py +++ b/akarpov/files/views.py @@ -17,11 +17,14 @@ from django_tables2 import SingleTableView from django_tables2.export import ExportMixin +from akarpov.common.views import SuperUserRequiredMixin from akarpov.contrib.chunked_upload.exceptions import ChunkedUploadError from akarpov.contrib.chunked_upload.models import ChunkedUpload from akarpov.contrib.chunked_upload.views import ( - ChunkedUploadCompleteView, - ChunkedUploadView, + ChunkedUploadCompleteView as ChunkedUploadABSCompleteView, +) +from akarpov.contrib.chunked_upload.views import ( + ChunkedUploadView as ChunkedUploadABSView, ) from akarpov.files.filters import FileFilter from akarpov.files.forms import FileForm, FolderForm @@ -207,7 +210,7 @@ def get_redirect_url(self, *args, **kwargs): delete_file_view = DeleteFileView.as_view() -class ChunkedUploadView(ChunkedUploadView): +class ChunkedUploadView(ChunkedUploadABSView): model = ChunkedUpload field_name = "the_file" @@ -218,7 +221,7 @@ def check_permissions(self, request): ) -class ChunkedUploadCompleteView(ChunkedUploadCompleteView): +class ChunkedUploadCompleteView(ChunkedUploadABSCompleteView): def __init__(self, **kwargs): super().__init__(**kwargs) self.message = {} @@ -298,14 +301,10 @@ def get_redirect_url(self, *args, **kwargs): report_file = ReportFileView.as_view() -class ListFileReports(LoginRequiredMixin, ListView): +class ListFileReports(SuperUserRequiredMixin, ListView): model = FileReport + queryset = FileReport.objects.all() template_name = "files/reports.html" - def get_queryset(self): - if self.request.user.is_superuser: - return FileReport.objects.all() - return FileReport.objects.none() - file_report_list = ListFileReports.as_view() diff --git a/akarpov/templates/files/list.html b/akarpov/templates/files/list.html index 9cd3496..006ea62 100644 --- a/akarpov/templates/files/list.html +++ b/akarpov/templates/files/list.html @@ -36,7 +36,7 @@
{% if is_folder_owner %} {% if folder_slug %} -