Skip to content

Commit

Permalink
- 重新兼容了v1.9.1之前的版本直接升级
Browse files Browse the repository at this point in the history
- 索引站点新增支持`HDVBits`
- 自定义重命名新增季年份`season_year`占位符
- 修复了普通用户搜索越权问题
  • Loading branch information
jxxghp committed Jul 1, 2024
1 parent d4a9643 commit 971b02a
Show file tree
Hide file tree
Showing 25 changed files with 745 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: MoviePilot Builder
on:
workflow_dispatch:
push:
branches:
- main
paths:
- version.py

jobs:
Docker-build:
Expand Down
23 changes: 23 additions & 0 deletions app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ class Settings(BaseSettings):
# 服务器地址,对应 https://github.com/jxxghp/MoviePilot-Server 项目
MP_SERVER_HOST: str = "https://movie-pilot.org"

# 【已弃用】刮削入库的媒体文件
SCRAP_METADATA: bool = True
# 【已弃用】下载保存目录,容器内映射路径需要一致
DOWNLOAD_PATH: Optional[str] = None
# 【已弃用】电影下载保存目录,容器内映射路径需要一致
DOWNLOAD_MOVIE_PATH: Optional[str] = None
# 【已弃用】电视剧下载保存目录,容器内映射路径需要一致
DOWNLOAD_TV_PATH: Optional[str] = None
# 【已弃用】动漫下载保存目录,容器内映射路径需要一致
DOWNLOAD_ANIME_PATH: Optional[str] = None
# 【已弃用】下载目录二级分类
DOWNLOAD_CATEGORY: bool = False
# 【已弃用】媒体库目录,多个目录使用,分隔
LIBRARY_PATH: Optional[str] = None
# 【已弃用】电影媒体库目录名
LIBRARY_MOVIE_NAME: str = "电影"
# 【已弃用】电视剧媒体库目录名
LIBRARY_TV_NAME: str = "电视剧"
# 【已弃用】动漫媒体库目录名,不设置时使用电视剧目录
LIBRARY_ANIME_NAME: Optional[str] = None
# 【已弃用】二级分类
LIBRARY_CATEGORY: bool = True

@validator("SUBSCRIBE_RSS_INTERVAL",
"COOKIECLOUD_INTERVAL",
"MEDIASERVER_SYNC_INTERVAL",
Expand Down
2 changes: 1 addition & 1 deletion app/modules/filetransfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def __convert_invalid_characters(filename: str):
# 季号
"season": meta.season_seq,
# 季年份根据season值获取
"season_year": mediainfo.season_years.get(int(meta.season_seq), None),
"season_year": mediainfo.season_years.get(int(meta.season_seq), None) if mediainfo.season_years else None,
# 集号
"episode": meta.episode_seqs,
# 季集 SxxExx
Expand Down
30 changes: 30 additions & 0 deletions database/versions/06abf3e7090b_1_0_11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""1.0.11
Revision ID: 06abf3e7090b
Revises: d633ca6cd572
Create Date: 2023-10-27 12:22:56.213376
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '06abf3e7090b'
down_revision = 'd633ca6cd572'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
try:
with op.batch_alter_table("downloadhistory") as batch_op:
batch_op.add_column(sa.Column('username', sa.String, nullable=True))
except Exception as e:
pass
# ### end Alembic commands ###


def downgrade() -> None:
pass
30 changes: 30 additions & 0 deletions database/versions/127a25fdf0e8_1_0_13.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""1.0.13
Revision ID: 127a25fdf0e8
Revises: d71e624f0208
Create Date: 2024-02-24 03:11:32.005540
"""

import contextlib
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '127a25fdf0e8'
down_revision = 'd71e624f0208'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with contextlib.suppress(Exception):
with op.batch_alter_table("subscribe") as batch_op:
batch_op.add_column(sa.Column('search_imdbid', sa.Integer, nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
pass
31 changes: 31 additions & 0 deletions database/versions/14f1813ae8e3_1_0_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""1.0.1
Revision ID: 14f1813ae8e3
Revises: 9f4edd55c2d4
Create Date: 2023-07-27 12:34:57.839443
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '14f1813ae8e3'
down_revision = '9f4edd55c2d4'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
try:
with op.batch_alter_table("subscribe") as batch_op:
batch_op.add_column(sa.Column('best_version', sa.Integer, nullable=True))
batch_op.add_column(sa.Column('current_priority', sa.Integer, nullable=True))
except Exception as e:
pass
# ### end Alembic commands ###


def downgrade() -> None:
pass
30 changes: 30 additions & 0 deletions database/versions/1e169250e949_1_0_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""1.0.4
Revision ID: 1e169250e949
Revises: 52ab4930be04
Create Date: 2023-09-01 09:56:33.907661
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '1e169250e949'
down_revision = '52ab4930be04'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
try:
with op.batch_alter_table("subscribe") as batch_op:
batch_op.add_column(sa.Column('date', sa.String, nullable=True))
except Exception as e:
pass
# ### end Alembic commands ###


def downgrade() -> None:
pass
38 changes: 38 additions & 0 deletions database/versions/232dfa044617_1_0_6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""1.0.6
Revision ID: 232dfa044617
Revises: e734c7fe6056
Create Date: 2023-09-19 21:34:41.994617
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = '232dfa044617'
down_revision = 'e734c7fe6056'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
# 搜索优先级
op.execute("delete from systemconfig where key = 'SearchFilterRules';")
op.execute(
"insert into systemconfig(key, value) VALUES('SearchFilterRules', (select value from systemconfig where key= 'FilterRules'));")
# 订阅优先级
op.execute("delete from systemconfig where key = 'SubscribeFilterRules';")
op.execute(
"insert into systemconfig(key, value) VALUES('SubscribeFilterRules', (select value from systemconfig where key= 'FilterRules'));")
# 洗版优先级
op.execute("delete from systemconfig where key = 'BestVersionFilterRules';")
op.execute(
"insert into systemconfig(key, value) VALUES('BestVersionFilterRules', (select value from systemconfig where key= 'FilterRules2'));")
# 删除旧的优先级规则
op.execute("delete from systemconfig where key = 'FilterRules';")
op.execute("delete from systemconfig where key = 'FilterRules2';")
# ### end Alembic commands ###


def downgrade() -> None:
pass
27 changes: 27 additions & 0 deletions database/versions/30329639c12b_1_0_7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""1.0.7
Revision ID: 30329639c12b
Revises: 232dfa044617
Create Date: 2023-09-23 08:25:59.776488
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = '30329639c12b'
down_revision = '232dfa044617'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("delete from systemconfig where key = 'DefaultFilterRules';")
op.execute(
"insert into systemconfig(key, value) VALUES('DefaultFilterRules', (select value from systemconfig where key= 'DefaultIncludeExcludeFilter'));")
op.execute("delete from systemconfig where key = 'DefaultIncludeExcludeFilter';")
# ### end Alembic commands ###


def downgrade() -> None:
pass
28 changes: 28 additions & 0 deletions database/versions/52ab4930be04_1_0_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""1_0_3
Revision ID: 52ab4930be04
Revises: ec5fb51fc300
Create Date: 2023-08-28 13:21:45.152012
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = '52ab4930be04'
down_revision = 'ec5fb51fc300'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("delete from systemconfig where key = 'RssSites';")
op.execute("insert into systemconfig(key, value) VALUES('RssSites', (select value from systemconfig where key= 'IndexerSites'));")
op.execute("delete from systemconfig where key = 'SearchResults';")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
34 changes: 34 additions & 0 deletions database/versions/5813aaa7cb3a_1_0_15.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""1.0.15
Revision ID: 5813aaa7cb3a
Revises: f94cd1217fd7
Create Date: 2024-03-17 09:04:51.785716
"""
import contextlib

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5813aaa7cb3a'
down_revision = 'f94cd1217fd7'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with contextlib.suppress(Exception):
with op.batch_alter_table("message") as batch_op:
batch_op.add_column(sa.Column('note', sa.String, nullable=True))
try:
op.create_index('ix_message_reg_time', 'message', ['reg_time'], unique=False)
except Exception as err:
pass
# ### end Alembic commands ###


def downgrade() -> None:
pass
31 changes: 31 additions & 0 deletions database/versions/735c01e0453d_1_0_18.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""1.0.18
Revision ID: 735c01e0453d
Revises: 9cb3993e340e
Create Date: 2024-04-29 19:40:38.375072
"""
import contextlib

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '735c01e0453d'
down_revision = '9cb3993e340e'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with contextlib.suppress(Exception):
with op.batch_alter_table("site") as batch_op:
batch_op.add_column(sa.Column('apikey', sa.VARCHAR))
batch_op.add_column(sa.Column('token', sa.VARCHAR))
# ### end Alembic commands ###


def downgrade() -> None:
pass
30 changes: 30 additions & 0 deletions database/versions/9cb3993e340e_1_0_17.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""1_0_17
Revision ID: 9cb3993e340e
Revises: d146dea51516
Create Date: 2024-03-28 14:36:35.588392
"""
import contextlib

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '9cb3993e340e'
down_revision = 'd146dea51516'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with contextlib.suppress(Exception):
with op.batch_alter_table("user") as batch_op:
batch_op.add_column(sa.Column('is_otp', sa.BOOLEAN, server_default='0'))
batch_op.add_column(sa.Column('otp_secret', sa.VARCHAR))
# ### end Alembic commands ###


def downgrade() -> None:
pass
Loading

0 comments on commit 971b02a

Please sign in to comment.