Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cyberdrop_dl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from cyberdrop_dl.models import format_validation_error
from cyberdrop_dl.models.types import HttpURL
from cyberdrop_dl.notifications import send_notifications
from cyberdrop_dl.progress.scraping import StatusMessage
from cyberdrop_dl.sorting import Sorter
from cyberdrop_dl.updates import check_latest_pypi
from cyberdrop_dl.utils import check_partials_and_empty_folders
Expand Down Expand Up @@ -199,6 +200,19 @@ async def load_items() -> AsyncGenerator[ScrapeItem]:
aio.run(scrape(manager, load_items))


@app.command()
def transfer(db_path: Path, output_path: Path, /) -> None:
"""Transfer an old database file (v8.10) to the newer v10 format"""
with setup_logging(Path("cdl_transfer.log"), level=logging.DEBUG):
logger.warning(
" Make sure the old database is from version 8.10. Otherwise the migration may fail. Press any key to continue"
)
from cyberdrop_dl.database2.transfer import migrate

with StatusMessage("Database transfer in progress...").activity:
migrate(db_path, output_path)


def main() -> None:
app()

Expand Down
Loading
Loading