bonukai / MediaTracker

Self hosted media tracker for movies, tv shows, video games, books and audiobooks
MIT License
572 stars 23 forks source link

/seen/by-external-id API endpoint never completes #546

Open thespad opened 1 year ago

thespad commented 1 year ago

When submitting an API request to /seen/by-external-id, such as

curl -LX 'PUT' --trace-ascii -  'http://localhost:7481/api/seen/by-external-id?token=vxiwSNXwxMp5Xrfy04AXCA30FPUQig'   -H 'accept: application/text'   -H 'Content-Type: application/json'   -d '{"mediaType": "tv","id": {"imdbId": "tt0804484","tmdbId": 439258},"seasonNumber": "2","episodeNumber": "9","duration": "3660000"}'

Mediatracker logs the request

debug: seen entry for userId 1, mediaItemId: 170, episodeId: 2175 already exists, at Wed Sep 13 2023 09:30:00 GMT+0100 (British Summer Time)

But the connection is never completed and will hang forever (or until a connection timeout is reached if one is set)

== Info:   Trying 127.0.0.1:7481...
== Info: Connected to localhost (127.0.0.1) port 7481 (#0)
=> Send header, 204 bytes (0xcc)
0000: PUT /api/seen/by-external-id?token=vxiwSNXwxMp5Xrfy04AXCA30FPUQi
0040: g HTTP/1.1
004c: Host: localhost:7481
0062: User-Agent: curl/7.81.0
007b: accept: application/text
0095: Content-Type: application/json
00b5: Content-Length: 129
00ca: 
=> Send data, 129 bytes (0x81)
0000: {"mediaType": "tv","id": {"imdbId": "tt0804484","tmdbId": 439258
0040: },"seasonNumber": "2","episodeNumber": "9","duration": "3660000"
0080: }
== Info: Operation timed out after 5000 milliseconds with 0 bytes received
== Info: Closing connection 0
curl: (28) Operation timed out after 5000 milliseconds with 0 bytes received

Interestingly the request isn't logged in the http.log file, only in the debug.log file.

Other PUT endpoints I've tested such as /rating seem to work as expected.