Skip to content

Commit

Permalink
Merge pull request #514 from kagemomiji/issue318-clarify-library-of-s…
Browse files Browse the repository at this point in the history
…earch-result

#318 Clarify library of search result
  • Loading branch information
kagemomiji authored Jun 23, 2024
2 parents 8e6bcbf + 7fde6a9 commit 517346e
Show file tree
Hide file tree
Showing 43 changed files with 457 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push multiplatform images to Dockerhub
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: install/docker/Dockerfile
context: install/docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push images to GHCR
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: install/docker/Dockerfile
context: install/docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_build_docker_from_fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push images to GHCR
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: install/docker/Dockerfile
context: install/docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- run: mkdir -p install/docker/target/dependency
- run: cp airsonic-main/target/airsonic.war install/docker/target/dependency/airsonic-main.war
- name: Build and push multiplatform images to Dockerhub
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: install/docker/Dockerfile
context: install/docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.22.0
uses: aquasecurity/trivy-action@0.23.0
with:
scan-type: 'fs'
format: 'sarif'
Expand Down
4 changes: 2 additions & 2 deletions airsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand Down Expand Up @@ -465,7 +465,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.9.7</version>
<version>3.9.8</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2024 (C) Y.Tory
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
Expand All @@ -23,11 +24,9 @@
import org.airsonic.player.domain.MediaFile;
import org.airsonic.player.domain.Player;
import org.airsonic.player.domain.User;
import org.apache.commons.lang3.tuple.Pair;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Command used in {@link SearchController}.
Expand All @@ -37,8 +36,10 @@
public class SearchCommand {

private String query;
private Map<String, Set<Integer>> artists;
private Map<Pair<String, String>, Set<Integer>> albums;
private List<SearchResultArtist> artists = new ArrayList<>();
private List<SearchResultArtist> artistsFromTag = new ArrayList<>();
private List<SearchResultAlbum> albums;
private List<SearchResultAlbum> albumsFromTag;
private List<MediaFile> songs;
private boolean isIndexBeingCreated;
private User user;
Expand All @@ -61,22 +62,38 @@ public void setIndexBeingCreated(boolean indexBeingCreated) {
isIndexBeingCreated = indexBeingCreated;
}

public Map<String, Set<Integer>> getArtists() {
public List<SearchResultArtist> getArtists() {
return artists;
}

public void setArtists(Map<String, Set<Integer>> artists) {
public void setArtists(List<SearchResultArtist> artists) {
this.artists = artists;
}

public Map<Pair<String, String>, Set<Integer>> getAlbums() {
public List<SearchResultArtist> getArtistsFromTag() {
return artistsFromTag;
}

public void setArtistsFromTag(List<SearchResultArtist> artistsFromTag) {
this.artistsFromTag = artistsFromTag;
}

public List<SearchResultAlbum> getAlbums() {
return albums;
}

public void setAlbums(Map<Pair<String, String>, Set<Integer>> albums) {
public void setAlbums(List<SearchResultAlbum> albums) {
this.albums = albums;
}

public List<SearchResultAlbum> getAlbumsFromTag() {
return albumsFromTag;
}

public void setAlbumsFromTag(List<SearchResultAlbum> albumsFromTag) {
this.albumsFromTag = albumsFromTag;
}

public List<MediaFile> getSongs() {
return songs;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
This file is part of Airsonic.
Airsonic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Airsonic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2024 (C) Y.Tory
*/
package org.airsonic.player.command;

import org.airsonic.player.domain.MusicFolder;

import java.util.HashSet;
import java.util.Set;

public class SearchResultAlbum {

private String album;

private String artist;

private MusicFolder folder;

private Set<Integer> mediaFileIds = new HashSet<>();

public SearchResultAlbum(String album, String artist, MusicFolder folder) {
this.album = album;
this.artist = artist;
this.folder = folder;
}

public String getAlbum() {
return album;
}

public void setAlbum(String album) {
this.album = album;
}

public String getArtist() {
return artist;
}

public void setArtist(String artist) {
this.artist = artist;
}

public MusicFolder getFolder() {
return folder;
}

public void setFolder(MusicFolder folder) {
this.folder = folder;
}

public Set<Integer> getMediaFileIds() {
return mediaFileIds;
}

public void setMediaFileIds(Set<Integer> mediaFileIds) {
this.mediaFileIds = mediaFileIds;
}

public void addMediaFileId(Integer mediaFileId) {
this.mediaFileIds.add(mediaFileId);
}

public void addMediaFileIds(Set<Integer> mediaFileIds) {
this.mediaFileIds.addAll(mediaFileIds);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
This file is part of Airsonic.
Airsonic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Airsonic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2024 (C) Y.Tory
*/
package org.airsonic.player.command;

import org.airsonic.player.domain.MusicFolder;

import java.util.HashSet;
import java.util.Set;

public class SearchResultArtist {

private String artist;

private MusicFolder folder;

private Set<Integer> mediaFileIds = new HashSet<>();

public SearchResultArtist(String artist, MusicFolder folder) {
this.artist = artist;
this.folder = folder;
}

public String getArtist() {
return artist;
}

public void setArtist(String artist) {
this.artist = artist;
}

public MusicFolder getFolder() {
return folder;
}

public void setFolder(MusicFolder folder) {
this.folder = folder;
}

public Set<Integer> getMediaFileIds() {
return mediaFileIds;
}

public void setMediaFileIds(Set<Integer> mediaFileIds) {
this.mediaFileIds = mediaFileIds;
}

public void addMediaFileId(Integer mediaFileId) {
this.mediaFileIds.add(mediaFileId);
}

public void addMediaFileIds(Set<Integer> mediaFileIds) {
this.mediaFileIds.addAll(mediaFileIds);
}

}
Loading

0 comments on commit 517346e

Please sign in to comment.