[videos] Fix saving imdb_id duplicates
All checks were successful
build & deploy / test (push) Successful in 2m1s
build & deploy / deploy (push) Successful in 22s

This commit is contained in:
2026-03-21 14:35:39 -04:00
parent a36abacfbd
commit 190f486c49
5 changed files with 88 additions and 68 deletions

View File

@ -3,6 +3,24 @@ from unittest.mock import MagicMock, patch
from scrobbles.scrobblers import jellyfin_scrobble_media, mopidy_scrobble_media
def test_jellyfin_scrobble_video_with_no_imdb_id():
with patch("scrobbles.scrobblers.Video") as mock_video_class:
mock_video_class.find_or_create.return_value = None
post_data = {
"ItemType": "Video",
"Name": "Test Video",
"Provider_imdb": "",
"PlaybackPosition": "00:05:00",
"NotificationType": "PlaybackProgress",
"UtcTimestamp": "2024-01-15T10:30:00Z",
}
result = jellyfin_scrobble_media(post_data, 1)
mock_video_class.find_or_create.assert_called_once_with(None)
def test_jellyfin_scrobble_media_ignores_progress_with_zero_position():
post_data = {