Skip to content

#662 Fixed the logic of getting files from playlist#774

Merged
kagemomiji merged 15 commits intomainfrom
issue662-fix-playlist-transaction-issue
Aug 30, 2025
Merged

#662 Fixed the logic of getting files from playlist#774
kagemomiji merged 15 commits intomainfrom
issue662-fix-playlist-transaction-issue

Conversation

@kagemomiji
Copy link
Owner

Fix #662
This pull request refactors playlist creation and retrieval logic, improves separation of concerns, and introduces new repository methods and tests for handling playlist media files.
The main changes include moving playlist-related logic out of the controller into the service layer, updating dependency injection patterns, and adding a dedicated repository and test coverage for playlist media file retrieval.

Playlist creation and controller/service refactoring:

  • Refactored PlaylistWSController to remove direct dependencies on MediaFolderService and PlayerService, delegating playlist creation for starred songs and play queues to new service methods (createPlaylistForStarredSongs, createPlaylistForPlayQueue) in PlaylistService. This simplifies the controller and centralizes playlist logic. [1] [2]
  • Updated PlaylistService to use constructor-based dependency injection for all required services and repositories, improving testability and code clarity.

Repository and data access improvements:

  • Added PlaylistMediaFileRepository with a new findMediaFilesByPlaylistId method to efficiently fetch media files for a playlist, ordered by their position. The service layer now uses this repository instead of traversing entity relationships directly. [1] [2]

Service layer enhancements:

  • Implemented new transactional methods in PlaylistService for creating playlists from play queues and starred songs, encapsulating formatting, resource bundle lookup, and file assignment logic.

Test coverage:

  • Added PlaylistMediaFileRepositoryTest to verify correct retrieval and ordering of media files for playlists, including edge cases for empty results.
  • Updated PlaylistServiceTest to mock the new repository and ensure compatibility with the refactored service. [1] [2]

[1] [2] [3] [4] [5] [6] [7] [8] [9]

kagemomiji and others added 15 commits August 26, 2025 09:11
Bumps [io.dropwizard.metrics:metrics-jmx](https://github.com/dropwizard/metrics) from 4.2.33 to 4.2.34.
- [Release notes](https://github.com/dropwizard/metrics/releases)
- [Commits](dropwizard/metrics@v4.2.33...v4.2.34)

---
updated-dependencies:
- dependency-name: io.dropwizard.metrics:metrics-jmx
  dependency-version: 4.2.34
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jsoup:jsoup](https://github.com/jhy/jsoup) from 1.21.1 to 1.21.2.
- [Release notes](https://github.com/jhy/jsoup/releases)
- [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES.md)
- [Commits](jhy/jsoup@jsoup-1.21.1...jsoup-1.21.2)

---
updated-dependencies:
- dependency-name: org.jsoup:jsoup
  dependency-version: 1.21.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.33 to 4.2.34.
- [Release notes](https://github.com/dropwizard/metrics/releases)
- [Commits](dropwizard/metrics@v4.2.33...v4.2.34)

---
updated-dependencies:
- dependency-name: io.dropwizard.metrics:metrics-core
  dependency-version: 4.2.34
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.32.0 to 0.33.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](aquasecurity/trivy-action@0.32.0...0.33.0)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [io.dropwizard.metrics:metrics-jmx](https://github.com/dropwizard/metrics) from 4.2.33 to 4.2.35.
- [Release notes](https://github.com/dropwizard/metrics/releases)
- [Commits](dropwizard/metrics@v4.2.33...v4.2.35)

---
updated-dependencies:
- dependency-name: io.dropwizard.metrics:metrics-jmx
  dependency-version: 4.2.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.33 to 4.2.35.
- [Release notes](https://github.com/dropwizard/metrics/releases)
- [Commits](dropwizard/metrics@v4.2.33...v4.2.35)

---
updated-dependencies:
- dependency-name: io.dropwizard.metrics:metrics-core
  dependency-version: 4.2.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.checkerframework:checker-qual](https://github.com/typetools/checker-framework) from 3.49.5 to 3.50.0.
- [Release notes](https://github.com/typetools/checker-framework/releases)
- [Changelog](https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md)
- [Commits](typetools/checker-framework@checker-framework-3.49.5...checker-framework-3.50.0)

---
updated-dependencies:
- dependency-name: org.checkerframework:checker-qual
  dependency-version: 3.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…etrics-metrics-jmx-4.2.34' into issue662-fix-playlist-transaction-issue
…-1.21.2' into issue662-fix-playlist-transaction-issue
…etrics-metrics-core-4.2.34' into issue662-fix-playlist-transaction-issue
…curity/trivy-action-0.33.0' into issue662-fix-playlist-transaction-issue
…etrics-metrics-jmx-4.2.35' into issue662-fix-playlist-transaction-issue
…ework-checker-qual-3.50.0' into issue662-fix-playlist-transaction-issue
@kagemomiji kagemomiji enabled auto-merge August 30, 2025 12:42
@kagemomiji kagemomiji merged commit a6cc391 into main Aug 30, 2025
17 checks passed
@kagemomiji kagemomiji deleted the issue662-fix-playlist-transaction-issue branch August 30, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: All playlists are empty

1 participant