Merge pull request #1541 from WangEdward/main
This commit is contained in:
commit
a0af827319
@ -83,10 +83,11 @@ def create_subscribe(
|
|||||||
username=current_user.name,
|
username=current_user.name,
|
||||||
best_version=subscribe_in.best_version,
|
best_version=subscribe_in.best_version,
|
||||||
save_path=subscribe_in.save_path,
|
save_path=subscribe_in.save_path,
|
||||||
|
search_imdbid=subscribe_in.search_imdbid,
|
||||||
exist_ok=True)
|
exist_ok=True)
|
||||||
return schemas.Response(success=True if sid else False, message=message, data={
|
return schemas.Response(
|
||||||
"id": sid
|
success=bool(sid), message=message, data={"id": sid}
|
||||||
})
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.put("/", summary="更新订阅", response_model=schemas.Response)
|
@router.put("/", summary="更新订阅", response_model=schemas.Response)
|
||||||
|
@ -279,7 +279,8 @@ class SubscribeChain(ChainBase):
|
|||||||
no_exists=no_exists,
|
no_exists=no_exists,
|
||||||
sites=sites,
|
sites=sites,
|
||||||
priority_rule=priority_rule,
|
priority_rule=priority_rule,
|
||||||
filter_rule=filter_rule)
|
filter_rule=filter_rule,
|
||||||
|
area="imdbid" if subscribe.search_imdbid else "title")
|
||||||
if not contexts:
|
if not contexts:
|
||||||
logger.warn(f'订阅 {subscribe.keyword or subscribe.name} 未搜索到资源')
|
logger.warn(f'订阅 {subscribe.keyword or subscribe.name} 未搜索到资源')
|
||||||
self.finish_subscribe_or_not(subscribe=subscribe, meta=meta,
|
self.finish_subscribe_or_not(subscribe=subscribe, meta=meta,
|
||||||
|
@ -67,6 +67,8 @@ class Subscribe(Base):
|
|||||||
current_priority = Column(Integer)
|
current_priority = Column(Integer)
|
||||||
# 保存路径
|
# 保存路径
|
||||||
save_path = Column(String)
|
save_path = Column(String)
|
||||||
|
# 是否使用 imdbid 搜索
|
||||||
|
search_imdbid = Column(Integer, default=0)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@db_query
|
@db_query
|
||||||
|
@ -59,6 +59,8 @@ class Subscribe(BaseModel):
|
|||||||
current_priority: Optional[int] = None
|
current_priority: Optional[int] = None
|
||||||
# 保存路径
|
# 保存路径
|
||||||
save_path: Optional[str] = None
|
save_path: Optional[str] = None
|
||||||
|
# 是否使用 imdbid 搜索
|
||||||
|
search_imdbid: Optional[int] = 0
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
orm_mode = True
|
orm_mode = True
|
||||||
|
30
database/versions/127a25fdf0e8_1_0_13.py
Normal file
30
database/versions/127a25fdf0e8_1_0_13.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user