mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-23 22:27:17 -04:00
Added announcements for deprecated Sonarr and Radarr versions end of support.
This commit is contained in:
parent
ec65f05399
commit
17e62f2d29
3 changed files with 42 additions and 0 deletions
|
@ -13,6 +13,8 @@ from operator import itemgetter
|
|||
from app.get_providers import get_enabled_providers
|
||||
from app.database import TableAnnouncements
|
||||
from .get_args import args
|
||||
from sonarr.info import get_sonarr_info
|
||||
from radarr.info import get_radarr_info
|
||||
|
||||
|
||||
# Announcements as receive by browser must be in the form of a list of dicts converted to JSON
|
||||
|
@ -84,6 +86,24 @@ def get_local_announcements():
|
|||
'timestamp': 1676236978,
|
||||
})
|
||||
|
||||
# deprecated Sonarr and Radarr versions
|
||||
if get_sonarr_info.is_deprecated():
|
||||
announcements.append({
|
||||
'text': f'Sonarr {get_sonarr_info.version()} is deprecated and unsupported. You should consider upgrading '
|
||||
f'as Bazarr will eventually drop support for deprecated Sonarr version.',
|
||||
'link': 'https://forums.sonarr.tv/t/v3-is-now-officially-stable-v2-is-eol/27858',
|
||||
'dismissible': False,
|
||||
'timestamp': 1679606061,
|
||||
})
|
||||
if get_radarr_info.is_deprecated():
|
||||
announcements.append({
|
||||
'text': f'Radarr {get_radarr_info.version()} is deprecated and unsupported. You should consider upgrading '
|
||||
f'as Bazarr will eventually drop support for deprecated Radarr version.',
|
||||
'link': 'https://discord.com/channels/264387956343570434/264388019585286144/1051567458697363547',
|
||||
'dismissible': False,
|
||||
'timestamp': 1679606309,
|
||||
})
|
||||
|
||||
for announcement in announcements:
|
||||
if 'enabled' not in announcement:
|
||||
announcement['enabled'] = True
|
||||
|
|
|
@ -59,6 +59,17 @@ class GetRadarrInfo:
|
|||
else:
|
||||
return False
|
||||
|
||||
def is_deprecated(self):
|
||||
"""
|
||||
Call self.version() and parse the result to determine if it's a deprecated version of Radarr
|
||||
@return: bool
|
||||
"""
|
||||
radarr_version = self.version()
|
||||
if radarr_version.startswith(('0.', '3.')):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
get_radarr_info = GetRadarrInfo()
|
||||
|
||||
|
|
|
@ -59,6 +59,17 @@ class GetSonarrInfo:
|
|||
else:
|
||||
return False
|
||||
|
||||
def is_deprecated(self):
|
||||
"""
|
||||
Call self.version() and parse the result to determine if it's a deprecated version of Sonarr
|
||||
@return: bool
|
||||
"""
|
||||
sonarr_version = self.version()
|
||||
if sonarr_version.startswith(('0.', '2.')):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
get_sonarr_info = GetSonarrInfo()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue