Bootstrap jellyfin-cleanup as a proper Python project - #1
Merged
Merged
Conversation
Co-authored-by: obnoxiousmods <18523901+obnoxiousmods@users.noreply.github.com> Agent-Logs-Url: https://github.com/obnoxiousmods/jellyfinCleaner/sessions/1fd1de5c-da74-4d15-9a41-70ac816e6f4c
Copilot
AI
changed the title
[WIP] Add CLI for finding and deleting Jellyfin library items
Bootstrap jellyfin-cleanup as a proper Python project
Mar 20, 2026
obnoxiousmods
marked this pull request as ready for review
March 20, 2026 22:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo contained only a README stub and
.gitignore. This PR scaffolds a full, installable Python project around the providedjellyfin_cleanup.pyscript.Core script
jellyfin_cleanup.py— async CLI tool as specified, plus amain_sync()wrapper to serve as the[project.scripts]entry pointPackaging (
pyproject.toml)setuptoolsbuild backend,requires-python = ">=3.11"httpx>=0.27pytest,pytest-asyncio,ruff,respxjellyfin-cleanupconsole scriptTests (
tests/)test_db.py— 18 tests coveringupsert_items,get_pending_targets, allmark_*helpers, anddb_statstest_cli.py— 22 tests covering API key resolution (flag → env var fallback), path merging/deduplication, flag defaults, and numeric paramsCI (
.github/workflows/ci.yml)ruff check+pyteston Python 3.11 and 3.12Docs
README.md— usage table, quick-start examples, how-it-works walkthroughCHANGELOG.md— v1.0.0 entryOriginal prompt
import argparse
import asyncio
import logging
import os
import random
import sqlite3
import sys
import time
from contextlib import contextmanager
from datetime import datetime, timezone
import httpx
---------------------------------------------------------------------------
CLI
---------------------------------------------------------------------------
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
prog="jellyfin_cleanup",
description="Find and delete Jellyfin library items by path prefix.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
---------------------------------------------------------------------------
Logging
---------------------------------------------------------------------------
def setup_logging(verbose: bool) -> None:
logging.basicConfig(
level=logging.DEBUG if verbose else logging.INFO,
format="%(asctime)s %...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.