mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-09 14:11:55 -04:00
Improve version comparison
This commit is contained in:
parent
26da00f1a2
commit
15c826d03e
3 changed files with 13 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "streamrip"
|
name = "streamrip"
|
||||||
version = "1.9.4"
|
version = "1.9.6"
|
||||||
description = "A fast, all-in-one music ripper for Qobuz, Deezer, Tidal, and SoundCloud"
|
description = "A fast, all-in-one music ripper for Qobuz, Deezer, Tidal, and SoundCloud"
|
||||||
authors = ["nathom <nathanthomas707@gmail.com>"]
|
authors = ["nathom <nathanthomas707@gmail.com>"]
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
|
|
13
rip/cli.py
13
rip/cli.py
|
@ -20,7 +20,7 @@ logging.basicConfig(level="WARNING")
|
||||||
logger = logging.getLogger("streamrip")
|
logger = logging.getLogger("streamrip")
|
||||||
|
|
||||||
outdated = False
|
outdated = False
|
||||||
newest_version = __version__
|
newest_version: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
class DownloadCommand(Command):
|
class DownloadCommand(Command):
|
||||||
|
@ -126,6 +126,7 @@ class DownloadCommand(Command):
|
||||||
self.line("<error>Must pass arguments. See </><cmd>rip url -h</cmd>.")
|
self.line("<error>Must pass arguments. See </><cmd>rip url -h</cmd>.")
|
||||||
|
|
||||||
update_check.join()
|
update_check.join()
|
||||||
|
|
||||||
if outdated:
|
if outdated:
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -814,7 +815,15 @@ def is_outdated():
|
||||||
global newest_version
|
global newest_version
|
||||||
r = requests.get("https://pypi.org/pypi/streamrip/json").json()
|
r = requests.get("https://pypi.org/pypi/streamrip/json").json()
|
||||||
newest_version = r["info"]["version"]
|
newest_version = r["info"]["version"]
|
||||||
outdated = newest_version != __version__
|
|
||||||
|
# Compare versions
|
||||||
|
curr_version_parsed = map(int, __version__.split("."))
|
||||||
|
newest_version_parsed = map(int, newest_version.split("."))
|
||||||
|
outdated = False
|
||||||
|
for c, n in zip(curr_version_parsed, newest_version_parsed):
|
||||||
|
outdated = c < n
|
||||||
|
if c != n:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""streamrip: the all in one music downloader."""
|
"""streamrip: the all in one music downloader."""
|
||||||
|
|
||||||
__version__ = "1.9.4"
|
__version__ = "1.9.6"
|
||||||
|
|
||||||
from . import clients, constants, converter, downloadtools, media
|
from . import clients, constants, converter, downloadtools, media
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue