mirror of
https://github.com/yattee/yattee.git
synced 2026-10-29 07:57:17 +00:00
Let rows update their counts, drop fake dates, and own failed lookups
MAC6: a snapshot mutation carries its video count back to the list cache. MAC8: playlist rows and cards are Buttons with the context menu attached, so macOS accessibility can reach Edit and Delete. MAC10: a published date stamped with the request's own time is dropped at both API sentinels, and formattedPublishedDate refuses zero-interval output. MAC11: a failed history hydration shows Details unavailable with a Try Again action instead of keeping the raw video ID forever; an empty 200 body is a legible failure.
This commit is contained in:
@@ -228,6 +228,16 @@ actor HTTPClient {
|
||||
) async throws -> T {
|
||||
let data = try await performRaw(request, customHeaders: customHeaders)
|
||||
|
||||
// A body with nothing in it is a failed answer however the status line
|
||||
// reads: instances do answer `200` with zero bytes, and that is not a
|
||||
// response any of these types can be decoded from.
|
||||
guard !data.isEmpty else {
|
||||
Task { @MainActor in
|
||||
LoggingService.shared.error("API returned an empty response body", category: .api)
|
||||
}
|
||||
throw APIError.decodingError("Empty response body")
|
||||
}
|
||||
|
||||
do {
|
||||
return try decoder.decode(T.self, from: data)
|
||||
} catch let error as DecodingError {
|
||||
|
||||
Reference in New Issue
Block a user