Skip to content

Keep download() from overwriting versions of one item - #1659

Open
benjohngf wants to merge 1 commit into
pushingkarmaorg:masterfrom
benjohngf:fix-download-multiple-parts
Open

benjohngf wants to merge 1 commit into
pushingkarmaorg:masterfrom
benjohngf:fix-download-multiple-parts

Conversation

@benjohngf

Copy link
Copy Markdown

Description

When download() gave several parts of an item one friendly filename, only the last file survived. Filenames now get - 1, - 2 for several versions, and - pt1, - pt2 for split parts. Other names are unchanged.

Numbers, not labels, since two versions can share a resolution and bitrate. The MediaPart rework from the issue is left out. Transcode downloads no longer raise when the item reloads while its filename is built.

Tested on a real Plex 1.43.6 server built with tools/plex-bootstraptest.py (Photos added by hand: the script's Photos step fails on 1.43.6). Master and this change fail the same 27 suite tests. I then gave one movie a second version and split another in two; master left one file per movie, this change two. The bootstrap script makes no such movies, so the five new tests are mocked; four fail on master. Claimed server tests were not run.

Fixes #1208

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

When download() gave several parts of an item one friendly filename,
only the last file was kept on disk. Versions now get " - 1", " - 2"
and so on, and the parts of a split version get " - pt1", " - pt2".
An item with one version and one part keeps its current name, and
keep_original_name is untouched.

Downloading with transcode options also no longer raises ValueError
when the item reloads while its filename is built.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

download() on a file with multiple Media options clobbers itself

1 participant