Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase to replace manual concurrency management (channels and semaphores) with the sourcegraph/conc/iter library, improving code simplicity and maintainability.
Changes:
- Replaced manual goroutine + channel + semaphore patterns with
iter.Mapcalls across spotify, plex, and cinemaparadiso packages - Added new value-returning helper functions to work with
iter.Map - Removed explicit concurrency limit constants (spotifyThreads)
- Fixed a bug in plex.go where extractMoviesFromPlaylist was returning undetailed movies instead of detailed movies
- Updated TODO file to mark the refactoring task as complete
- Updated golangci-lint path in copilot instructions
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spotify/spotify.go | Refactored GetArtistsInParallel and GetAlbumsInParallel to use iter.Map, added value-returning helper functions |
| plex/plex.go | Refactored AllMovies, getPlexTVSeasons, and extractMoviesFromPlaylist to use iter.Map, added value-returning helper functions, fixed bug in extractMoviesFromPlaylist |
| cinemaparadiso/cinemaparadiso.go | Refactored MoviesInParallel, ScrapeMoviesParallel, and TVInParallel to use iter.Map, added value-returning helper functions |
| cinemaparadiso/cinemaparadiso_test.go | Updated TestSearchCinemaParadisoMovies to use new value-returning function |
| utils/utils.go | Removed placeholder comments |
| go.mod | Added sourcegraph/conc dependency |
| go.sum | Updated with new dependencies (conc and its transitive dependencies) |
| TODO | Marked concurrency refactoring task as complete |
| .github/copilot-instructions.md | Updated golangci-lint path from dynamic to hardcoded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.