DVinyl icon indicating copy to clipboard operation
DVinyl copied to clipboard

[Bug]: A movie and a TV show sharing a numeric TMDB id collide (seasons filed under the movie)

Open teaboyteaboy opened this issue 2 months ago • 1 comments

Before reporting

  • [x] I am running the latest version of DVinyl.
  • [x] I searched the existing issues and did not find a duplicate.

What happened?

TMDB ids are only unique within a media type — movie 155 and tv 155 are entirely different works (themoviedb.org/movie/155 is The Dark Knight, themoviedb.org/tv/155 is 3rd Rock from the Sun). The Movies/TV Shows plugin stores tmdb_id as a bare number and matches on it without also checking media_type, so a movie and a show that happen to share a numeric id are treated as the same item.

Concretely: with The Dark Knight (movie 155) already in the collection, adding the show 3rd Rock from the Sun (tv 155) reports it as already added, and its seasons get filed as seasons of The Dark Knight.

Steps to reproduce

  1. Add the movie The Dark Knight (TMDB movie id 155).
  2. Add the TV show 3rd Rock from the Sun (TMDB tv id 155) via search.
  3. It is reported as already in the collection, and adding its seasons attaches them under The Dark Knight (opening the movie shows the show's seasons beneath it).

Low numeric ids overlap heavily between TMDB's movie and TV spaces, so this is easy to hit.

Expected behavior

A movie and a TV show with the same numeric TMDB id are distinct items. Duplicate detection and the season holder lookup should match tmdb_id and media_type.

DVinyl version

3.2.0

How are you running DVinyl?

Docker (pre-built image)

Affected media type or plugin

Movies/TV Shows (the dvds plugin). Root cause is three tmdb_id-only queries in plugins/dvds/index.ts: the season-add holder lookup, findDuplicate, and findPotentialDuplicates.

Logs or screenshots

No error is logged — it is a wrong-match issue. I hit this on a plugin of my own that shares the same code shape, fixed it there, and confirmed the fix (the show now adds as its own item and the movie still dedupes correctly). PR for the dvds plugin to follow.

teaboyteaboy avatar Sep 29 '26 07:09 teaboyteaboy

Hi! I just released version 3.2.1, which includes your fix from PR #184 :D

Thanks a lot for the spot-on report and the PR!

Feel free to reopen the issue if you run into any problems!

Kyonew avatar Oct 02 '26 17:10 Kyonew