From c55b54124bf2c4502d6363e767eb4ef0a2517087 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 27 Jun 2022 00:46:14 +0200 Subject: [PATCH 1/3] fix feed showing not downloaded videos --- ucast/feed.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ucast/feed.py b/ucast/feed.py index 8861804..c7dc07e 100644 --- a/ucast/feed.py +++ b/ucast/feed.py @@ -156,9 +156,9 @@ class UcastFeed(Feed): image_url=self.full_link_url(request, f"/files/avatar/{channel.slug}.jpg"), ) - for video in channel.video_set.order_by("-published")[ - : settings.FEED_MAX_ITEMS - ]: + for video in channel.video_set.filter(downloaded__isnull=False).order_by( + "-published" + )[: settings.FEED_MAX_ITEMS]: feed.add_item( title=video.title, link=video.get_absolute_url(), From 6622fe87f296e656d46138d5bfa7355bee89ab62 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 27 Jun 2022 01:00:19 +0200 Subject: [PATCH 2/3] add bump2version --- .bumpversion.cfg | 12 ++++++++++++ poetry.lock | 14 +++++++++++++- pyproject.toml | 1 + ucast/__init__.py | 4 ++++ ucast/templates/bulma/base.html | 1 + ucast_project/settings.py | 1 + 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..8762bde --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,12 @@ +[bumpversion] +current_version = 0.0.1 +commit = True +tag = True + +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" + +[bumpversion:file:ucast/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" diff --git a/poetry.lock b/poetry.lock index 91f67be..dedcf83 100644 --- a/poetry.lock +++ b/poetry.lock @@ -58,6 +58,14 @@ python-versions = "*" [package.dependencies] cffi = ">=1.0.0" +[[package]] +name = "bump2version" +version = "1.0.1" +description = "Version-bump your software with a single command!" +category = "dev" +optional = false +python-versions = ">=3.5" + [[package]] name = "certifi" version = "2022.5.18.1" @@ -768,7 +776,7 @@ websockets = "*" [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "a3da05c0c8552c9149eb04dee6e52c7f3fffd2de297a82595422511e3674f861" +content-hash = "41be11c588a5d47c4ddc2e06b5699ee9db0c3888e3576c0134d55e065f53cc0d" [metadata.files] asgiref = [ @@ -883,6 +891,10 @@ brotlicffi = [ {file = "brotlicffi-1.0.9.2-pp37-pypy37_pp73-win32.whl", hash = "sha256:7e72978f4090a161885b114f87b784f538dcb77dafc6602592c1cf39ae8d243d"}, {file = "brotlicffi-1.0.9.2.tar.gz", hash = "sha256:0c248a68129d8fc6a217767406c731e498c3e19a7be05ea0a90c3c86637b7d96"}, ] +bump2version = [ + {file = "bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410"}, + {file = "bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6"}, +] certifi = [ {file = "certifi-2022.5.18.1-py3-none-any.whl", hash = "sha256:f1d53542ee8cbedbe2118b5686372fb33c297fcd6379b050cca0ef13a597382a"}, {file = "certifi-2022.5.18.1.tar.gz", hash = "sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7"}, diff --git a/pyproject.toml b/pyproject.toml index 3556c9b..620c2df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ honcho = "^1.1.0" pytest-mock = "^3.7.0" fakeredis = "^1.7.5" gunicorn = "^20.1.0" +bump2version = "^1.0.1" [tool.poetry.scripts] "ucast-manage" = "ucast_project.manage:main" diff --git a/ucast/__init__.py b/ucast/__init__.py index f102a9c..f14f09c 100644 --- a/ucast/__init__.py +++ b/ucast/__init__.py @@ -1 +1,5 @@ __version__ = "0.0.1" + + +def template_context(request): + return {"version": __version__} diff --git a/ucast/templates/bulma/base.html b/ucast/templates/bulma/base.html index ac0a55e..431b8ce 100644 --- a/ucast/templates/bulma/base.html +++ b/ucast/templates/bulma/base.html @@ -22,6 +22,7 @@ diff --git a/ucast_project/settings.py b/ucast_project/settings.py index 0263581..24d64bb 100644 --- a/ucast_project/settings.py +++ b/ucast_project/settings.py @@ -126,6 +126,7 @@ TEMPLATES = [ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "ucast.template_context", ], }, }, From 71725c7a29870e56d0678333c1d9e0ae9670c07c Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 27 Jun 2022 01:01:01 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=200.0.1=20=E2=86=92=200.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- pyproject.toml | 2 +- ucast/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 8762bde..d78ccd0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.0.1 +current_version = 0.1.0 commit = True tag = True diff --git a/pyproject.toml b/pyproject.toml index 620c2df..871092f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ucast" -version = "0.0.1" +version = "0.1.0" description = "YouTube to Podcast converter" authors = ["Theta-Dev "] packages = [ diff --git a/ucast/__init__.py b/ucast/__init__.py index f14f09c..52428bd 100644 --- a/ucast/__init__.py +++ b/ucast/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.1" +__version__ = "0.1.0" def template_context(request):