mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-07 08:54:36 +01:00
update versions for pre-commit (#741)
This commit is contained in:
parent
4b0718c43f
commit
a3997bfb1c
17
.github/workflows/pre-commit.yml
vendored
Normal file
17
.github/workflows/pre-commit.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: pre-commit
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,15 +1,15 @@
|
||||
repos:
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 3.7.9
|
||||
rev: 6.0.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.5.4
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ["--profile", "black"]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
@ -18,7 +18,6 @@ class FastPaginationWithoutCount(PageNumberPagination):
|
||||
django_paginator_class = FasterDjangoPaginator
|
||||
|
||||
def get_paginated_response(self, data):
|
||||
|
||||
return Response(
|
||||
OrderedDict(
|
||||
[
|
||||
|
@ -102,7 +102,7 @@ class SearchRSSFeed(Feed):
|
||||
description = "Latest Media RSS feed"
|
||||
|
||||
def link(self, obj):
|
||||
return f"/rss/search"
|
||||
return "/rss/search"
|
||||
|
||||
def get_object(self, request):
|
||||
category = request.GET.get("c", "")
|
||||
|
@ -305,7 +305,6 @@ def show_related_media_author(media, request, limit):
|
||||
|
||||
|
||||
def show_related_media_calculated(media, request, limit):
|
||||
|
||||
"""Return a list of related media based on ML recommendations
|
||||
A big todo!
|
||||
"""
|
||||
|
@ -10,7 +10,6 @@ import files.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
@ -8,7 +8,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('files', '0002_auto_20201201_0712'),
|
||||
]
|
||||
|
@ -314,7 +314,6 @@ class Media(models.Model):
|
||||
self.__original_uploaded_poster = self.uploaded_poster
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
||||
if not self.title:
|
||||
self.title = self.media_file.path.split("/")[-1]
|
||||
|
||||
@ -372,7 +371,6 @@ class Media(models.Model):
|
||||
# will run only when a poster is uploaded for the first time
|
||||
if self.uploaded_poster and self.uploaded_poster != self.__original_uploaded_poster:
|
||||
with open(self.uploaded_poster.path, "rb") as f:
|
||||
|
||||
# set this otherwise gets to infinite loop
|
||||
self.__original_uploaded_poster = self.uploaded_poster
|
||||
|
||||
@ -580,9 +578,7 @@ class Media(models.Model):
|
||||
|
||||
# attempt to break media file in chunks
|
||||
if self.duration > settings.CHUNKIZE_VIDEO_DURATION and chunkize:
|
||||
|
||||
for profile in profiles:
|
||||
|
||||
if profile.extension == "gif":
|
||||
profiles.remove(profile)
|
||||
encoding = Encoding(media=self, profile=profile)
|
||||
|
@ -268,7 +268,6 @@ def encode_media(
|
||||
# return False
|
||||
|
||||
with tempfile.TemporaryDirectory(dir=settings.TEMP_DIRECTORY) as temp_dir:
|
||||
|
||||
tf = create_temp_file(suffix=".{0}".format(profile.extension), dir=temp_dir)
|
||||
tfpass = create_temp_file(suffix=".{0}".format(profile.extension), dir=temp_dir)
|
||||
ffmpeg_commands = produce_ffmpeg_commands(
|
||||
|
@ -10,7 +10,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
@ -176,7 +176,6 @@ Sender email: %s\n
|
||||
|
||||
|
||||
class UserList(APIView):
|
||||
|
||||
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
|
||||
parser_classes = (JSONParser, MultiPartParser, FormParser, FileUploadParser)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user