Commit 17029f99 authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/10.0.54'

parents e14cf364 f49068fe
......@@ -2,8 +2,14 @@
 
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
 
#### [10.0.54](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.53...10.0.54)
- Bumped PyYaml [`81c2da3`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/81c2da37b21bd2c4775171394009440a0235f83c)
#### [10.0.53](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.52...10.0.53)
 
> 16 March 2022
- Bumped beautifulsoup4 [`6de06e8`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/6de06e82382da5d455fa30e1e61033229ffca631)
 
#### [10.0.52](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.51...10.0.52)
......
{
"name": "sickrage",
"version": "10.0.53",
"version": "10.0.54",
"private": true,
"repository": {
"type": "git",
......
......@@ -30,6 +30,7 @@ fake-useragent==0.1.11
feedparser==6.0.8
future==0.18.2
gntp==1.0.3
greenlet==1.1.2
guessit==3.1.1
hachoir==3.1.1
html5lib==1.1
......@@ -73,7 +74,7 @@ python-keycloak-client==0.2.3
python-twitter==3.5
pytz==2020.1
pyxdg==0.26
PyYAML==5.3.1
PyYAML==5.4.1
rarfile==3.1
rebulk==2.0.1
requests==2.24.0
......@@ -87,8 +88,8 @@ sgmllib3k==1.0.0
simplejson==3.17.2
six==1.15.0
soupsieve==2.0.1
SQLAlchemy==1.3.18
SQLAlchemy-Utils==0.36.8
SQLAlchemy==1.4.32
SQLAlchemy-Utils==0.38.2
stevedore==3.2.0
subliminal==2.1.0
tornado==6.1
......
[bumpversion]
current_version = 10.0.53
current_version = 10.0.54
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
......
......@@ -19,7 +19,7 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
__version__ = "10.0.53"
__version__ = "10.0.54"
__install_type__ = ""
import argparse
......
This diff is collapsed.
......@@ -31,13 +31,12 @@ from alembic.runtime.migration import MigrationContext
from alembic.script import ScriptDirectory
from attrdict import AttrDict
from sqlalchemy import create_engine, event, inspect, MetaData, Index, TypeDecorator
from sqlalchemy.engine import Engine, reflection
from sqlalchemy.engine import Engine, reflection, Row
from sqlalchemy.exc import OperationalError
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.ext.serializer import loads, dumps
from sqlalchemy.orm import sessionmaker, mapper, scoped_session
from sqlalchemy.sql.ddl import CreateTable, CreateIndex
from sqlalchemy.util import KeyedTuple
import sickrage
......@@ -169,12 +168,12 @@ class SRDatabase(object):
return current_rev
def setup(self):
if self.engine.dialect.has_table(self.engine, 'migrate_version'):
if inspect(self.engine).has_table('migrate_version'):
migrate_version = self.engine.execute("select version from migrate_version").fetchone().version
alembic.command.stamp(self.get_alembic_config(), str(migrate_version))
self.engine.execute("drop table migrate_version")
if not self.engine.dialect.has_table(self.engine, 'alembic_version'):
if not inspect(self.engine).has_table('alembic_version'):
alembic.command.stamp(self.get_alembic_config(), 'head')
sickrage.app.log.info("Performing initialization on {} database".format(self.name))
self.initialize()
......@@ -207,7 +206,7 @@ class SRDatabase(object):
if db_version < alembic_version:
# temp code to resolve a migration bug introduced from v10.0.0, fixed in v10.0.2+
if db_version < 21 and self.name == 'main':
if self.engine.dialect.has_table(self.engine, 'indexer_mapping') and self.engine.dialect.has_table(self.engine, 'series_provider_mapping'):
if inspect(self.engine).has_table('indexer_mapping') and inspect(self.engine).has_table('series_provider_mapping'):
sickrage.app.log.debug('Found offending series_provider_mapping table, removing!')
metadata = MetaData(self.engine, reflect=True)
table = metadata.tables.get('series_provider_mapping')
......@@ -227,7 +226,9 @@ class SRDatabase(object):
return config
def get_metadata(self):
return MetaData(bind=self.engine, reflect=True)
metadata_obj = MetaData(bind=self.engine)
metadata_obj.reflect()
return metadata_obj
def get_base(self):
base = automap_base(metadata=self.get_metadata())
......@@ -274,6 +275,18 @@ class SRDatabase(object):
with open(filename, 'rb') as fh:
backup_dict = pickle.load(fh)
backup_version = int(backup_dict['version'])
restore_version_matrix = {
'main': 23,
'cache': 11,
'config': 6
}
if not backup_version >= restore_version_matrix[self.name]:
sickrage.app.log.warning(f'Backup v{backup_version} for {self.name} database cannot be restored, needs to be restored with an '
f'older copy of SiCKRAGE.')
return
# drop all tables
self.get_base().metadata.drop_all()
......@@ -304,7 +317,7 @@ class SRDatabase(object):
rows = []
for row in loads(data, meta, session):
if isinstance(row, KeyedTuple):
if isinstance(row, Row):
rows.append(row._asdict())
session.bulk_insert_mappings(table, rows)
session.commit()
......@@ -9,6 +9,8 @@ import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
from sqlalchemy import inspect
revision = '8'
down_revision = '7'
......@@ -17,10 +19,10 @@ def upgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
if conn.engine.dialect.has_table(conn.engine, 'quicksearch_shows'):
if inspect(conn).has_table('quicksearch_shows'):
op.drop_table('quicksearch_shows')
if conn.engine.dialect.has_table(conn.engine, 'quicksearch_episodes'):
if inspect(conn).has_table('quicksearch_episodes'):
op.drop_table('quicksearch_episodes')
......
......@@ -12,7 +12,7 @@ from json import JSONDecodeError
import sqlalchemy as sa
from alembic import op
from keycloak.exceptions import KeycloakClientError
from sqlalchemy import orm
from sqlalchemy import orm, inspect
import sickrage
......@@ -51,7 +51,7 @@ def upgrade():
except (KeycloakClientError, orm.exc.NoResultFound):
pass
if conn.engine.dialect.has_table(conn.engine, 'oauth2_token'):
if inspect(conn).has_table('oauth2_token'):
op.drop_table('oauth2_token')
......
"""Initial migration
Revision ID: 11
Revises:
Create Date: 2017-12-29 14:39:27.854291
"""
import json
import os
from json import JSONDecodeError
import sqlalchemy as sa
from alembic import op
from keycloak.exceptions import KeycloakClientError
from sqlalchemy import orm, inspect
import sickrage
# revision identifiers, used by Alembic.
from sickrage.core import ConfigDB
revision = '11'
down_revision = '10'
def upgrade():
pass
def downgrade():
# Operations to reverse the above upgrade go here.
pass
"""Initial migration
Revision ID: 6
Revises:
Create Date: 2017-12-29 14:39:27.854291
"""
import babelfish
from alembic import op
# revision identifiers, used by Alembic.
revision = '6'
down_revision = '5'
def upgrade():
pass
def downgrade():
pass
......@@ -331,7 +331,8 @@ class MainDB(SRDatabase):
last_backlog_search = Column(DateTime(timezone=True), default=datetime.datetime.now())
last_proper_search = Column(DateTime(timezone=True), default=datetime.datetime.now())
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', cascade="all, delete-orphan", lazy='dynamic')
episodes = relationship('TVEpisode', uselist=True, back_populates='show', cascade="all, delete-orphan", lazy='dynamic')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
series_provider_mapping = relationship('SeriesProviderMapping', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
blacklist = relationship('Blacklist', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
......@@ -380,7 +381,7 @@ class MainDB(SRDatabase):
version = Column(Integer, default=-1)
release_group = Column(Text, default='')
show = relationship('TVShow', uselist=False, backref='tv_episodes')
show = relationship('TVShow', uselist=False, back_populates='episodes')
class IMDbInfo(base):
__tablename__ = 'imdb_info'
......
......@@ -9,6 +9,8 @@ import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
from sqlalchemy import inspect
revision = '16'
down_revision = '15'
......@@ -17,7 +19,7 @@ def upgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
if conn.engine.dialect.has_table(conn.engine, 'scene_numbering'):
if inspect(conn).has_table('scene_numbering'):
scene_numbering = sa.Table('scene_numbering', meta, autoload=True)
with op.get_context().begin_transaction():
for row in conn.execute(scene_numbering.select()):
......
"""Initial migration
Revision ID: 23
Revises:
Create Date: 2017-12-29 14:39:27.854291
"""
import babelfish
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '23'
down_revision = '22'
def upgrade():
pass
def downgrade():
pass
......@@ -81729,7 +81729,7 @@ var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
if (isUndefined(debugEnviron))
debugEnviron = Object({"SENTRY_DSN":'https://[email protected]/2',"PACKAGE_VERSION":"10.0.53"}).NODE_DEBUG || '';
debugEnviron = Object({"SENTRY_DSN":'https://[email protected]/2',"PACKAGE_VERSION":"10.0.54"}).NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
......@@ -82538,7 +82538,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
 
Sentry.init({
dsn: 'https://[email protected]/2',
release: "10.0.53",
release: "10.0.54",
beforeSend: function beforeSend(event, hint) {
if (event.exception) {
event.exception.values[0].stacktrace.frames.forEach(function (frame) {
10.0.53
\ No newline at end of file
10.0.54
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment