Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#318 Clarify library of search result #514

Merged
merged 17 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b85c8f7
kagemomiji/airsonic-advanced#318 Divided search results to tag and fo…
kagemomiji Jun 20, 2024
4ebc7a9
kagemomiji/airsonic-advanced#318 Changed search results to show folder
kagemomiji Jun 22, 2024
b9a7fa7
Merge branch 'main' into issue318-clarify-library-of-search-result
kagemomiji Jun 22, 2024
639bb3e
kagemomiji/airsonic-advanced#318 Update search controller to handle a…
kagemomiji Jun 22, 2024
bfbb4a6
kagemomiji/airsonic-advanced#318 fixed Copyrights
kagemomiji Jun 22, 2024
d532234
Bump org.apache.commons:commons-configuration2 from 2.10.1 to 2.11.0
dependabot[bot] Jun 22, 2024
e69cd9e
Bump org.springframework.boot:spring-boot-starter-parent
dependabot[bot] Jun 23, 2024
8372094
Bump org.apache.maven.plugins:maven-checkstyle-plugin
dependabot[bot] Jun 23, 2024
2729043
Bump org.apache.maven:maven-artifact from 3.9.7 to 3.9.8
dependabot[bot] Jun 23, 2024
79d1860
Bump aquasecurity/trivy-action from 0.22.0 to 0.23.0
dependabot[bot] Jun 23, 2024
b000b45
Bump docker/build-push-action from 5 to 6
dependabot[bot] Jun 23, 2024
6a848a6
Merge remote-tracking branch 'origin/dependabot/maven/org.springframe…
kagemomiji Jun 23, 2024
73f1d4a
Merge remote-tracking branch 'origin/dependabot/maven/org.apache.mave…
kagemomiji Jun 23, 2024
3f5c354
Merge remote-tracking branch 'origin/dependabot/maven/org.apache.mave…
kagemomiji Jun 23, 2024
d49c6dd
Merge remote-tracking branch 'origin/dependabot/github_actions/aquase…
kagemomiji Jun 23, 2024
b1cfc27
Merge remote-tracking branch 'origin/dependabot/github_actions/docker…
kagemomiji Jun 23, 2024
7fde6a9
Merge remote-tracking branch 'origin/dependabot/maven/org.apache.comm…
kagemomiji Jun 23, 2024
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
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