wrolpi/alembic/versions/1a70196c05bb_download_location.py
Roland 785ad8274c
DownloadResult.try_again is not necessary.
Removing unused fixture in test.

Simplifying logic after download completes.  Removing unused download sorting method.

ChannelDownloader returns location.

Hiding View link when no location is provided.

Performing video upsert in try/except so any errors are attached to the Download.

Including stderr only.

Including logs when returning Downloader.process_runner.

Warning when extention is replaced.

Providing location link on Downloads page.  Showing error modal on errors that fail.

Handling empty URL strings on import.

Fixing channel download test.

Reworking how Channels schedule Video downloads.

Bumping version for DownloadResult.

Updating tests to use DownloadResult.

VideoDownloader returns a DownloadResult.
2022-05-10 21:20:36 -06:00

33 lines
870 B
Python

"""Download location
Revision ID: 1a70196c05bb
Revises: d8fcdb7773c0
Create Date: 2022-05-02 12:01:51.210070
"""
import os
from alembic import op
from sqlalchemy.orm import Session
# revision identifiers, used by Alembic.
revision = '1a70196c05bb'
down_revision = 'd8fcdb7773c0'
branch_labels = None
depends_on = None
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
def upgrade():
bind = op.get_bind()
session = Session(bind=bind)
session.execute('ALTER TABLE download ADD COLUMN IF NOT EXISTS location TEXT')
session.execute('ALTER TABLE download ADD COLUMN IF NOT EXISTS error TEXT')
def downgrade():
bind = op.get_bind()
session = Session(bind=bind)
session.execute('ALTER TABLE download DROP COLUMN IF EXISTS location')
session.execute('ALTER TABLE download DROP COLUMN IF EXISTS error')