Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions src/Tidalarr/Integration/TidalIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected override async Task<List<StreamingAlbum>> SearchAlbumsAsync(string sea
await this._statusReporter.ReportErrorAsync(ex);
}

return [];
throw;
}
}

Expand Down Expand Up @@ -173,7 +173,7 @@ internal async Task<List<StreamingTrack>> SearchTracksInternalAsync(string searc
await this._statusReporter.ReportErrorAsync(ex);
}

return [];
throw;
}
}

Expand All @@ -192,18 +192,26 @@ internal async Task<StreamingAlbum> GetAlbumDetailsInternalAsync(string albumId)
{
return mapped;
}

// Mapping returned null — return a safe default to satisfy non-nullable contract
return new StreamingAlbum
{
Id = albumId,
Title = string.Empty,
Artist = new StreamingArtist { Id = string.Empty, Name = string.Empty }
};
}
catch (Exception ex)
{
Logger?.LogError(ex, "Failed to get album details for: {AlbumId}", albumId);

if (this._statusReporter is not null)
{
await this._statusReporter.ReportErrorAsync(ex);
}

throw;
}
// Return a safe default to satisfy non-nullable contract
return new StreamingAlbum
{
Id = albumId,
Title = string.Empty,
Artist = new StreamingArtist { Id = string.Empty, Name = string.Empty }
};
}

protected override ValidationResult ValidateSettings(TidalIndexerSettings settings)
Expand Down Expand Up @@ -310,7 +318,13 @@ public async Task<List<StreamingSearchResult>> SearchEnhancedAsync(string query)
catch (Exception ex)
{
Logger?.LogError(ex, "Enhanced search failed for: {Query}", query);
return [];

if (this._statusReporter is not null)
{
await this._statusReporter.ReportErrorAsync(ex);
}

throw;
}
}

Expand Down
Loading