forked from airsonic-advanced/airsonic-advanced
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from kagemomiji/issue512-editable-artist-fold…
…er-name #512 Added Feature to Rename Artist Names
- Loading branch information
Showing
16 changed files
with
201 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
61 changes: 61 additions & 0 deletions
61
airsonic-main/src/main/java/org/airsonic/player/controller/EditMediaDirController.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
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.controller; | ||
|
||
import org.airsonic.player.domain.MediaFile; | ||
import org.airsonic.player.service.MediaFileService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.ServletRequestUtils; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
import org.springframework.web.servlet.view.RedirectView; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
|
||
/** | ||
* Controller for updating Media file | ||
* | ||
* @author Y. Tory | ||
*/ | ||
@Controller | ||
@RequestMapping({"/editMediaDir"}) | ||
public class EditMediaDirController { | ||
|
||
@Autowired | ||
private MediaFileService mediaFileService; | ||
|
||
@PostMapping | ||
protected ModelAndView handleRequestInternal(HttpServletRequest request) throws Exception { | ||
int id = ServletRequestUtils.getRequiredIntParameter(request, "id"); | ||
String action = request.getParameter("action"); | ||
|
||
MediaFile mediaFile = mediaFileService.getMediaFile(id); | ||
|
||
if ("editMediaDirTitle".equals(action) && mediaFile != null && mediaFile.isDirectory()) { | ||
mediaFile.setTitle(request.getParameter("mediaDirTitle")); | ||
mediaFileService.updateMediaFile(mediaFile); | ||
} | ||
|
||
String url = "main.view?id=" + id; | ||
return new ModelAndView(new RedirectView(url)); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Rule | ||
|
||
Airsonic Advanced categorizes directories and files into Album, Artist, Song, and Video using the following logic: | ||
|
||
| Type | Description | | ||
| --- | --- | | ||
| Song | A single audio file. If it has the specified extensions which defined in the `Settings` > `General` > `Music files` field, it is considered a song. | | ||
| Video | A single video file. If it has the specified extensions which defined in the `Settings` > `General` > `Video files` field, it is considered a video. | | ||
| Album | A parent directory containing at least one Song or Video. | | ||
| Artist | A parent directory containing albums. If it contains songs or videos directly, it is considered an album. | | ||
|
||
|
||
Therefore, it is understood as follows: | ||
|
||
``` | ||
. | ||
├── Artist1 | ||
│ ├── Album1 | ||
│ │ ├── Song1.flac | ||
│ │ ├── Song2.mp3 | ||
│ │ └── Folder.jpg | ||
│ ├── Artist2 | ||
│ │ ├── Album2 | ||
│ │ │ ├── Song3.ogg | ||
│ │ │ ├── Song4.ogg | ||
│ │ │ └── Folder.jpg | ||
│ │ └──Album3 | ||
│ │ ├── Song5.mp3 | ||
│ │ ├── Song6.mp3 | ||
│ │ └── Folder.jpeg | ||
├── Album2 | ||
│ ├── Song7.mp3 | ||
│ ├── Video1.mp4 | ||
│ └── Folder.jpg | ||
``` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Media | ||
|
||
The media section of the web UI allows you to browse and play your music. | ||
|
||
## Artist | ||
|
||
### Artist View | ||
|
||
![webui-media-artist](../figures/webui-media-artist.png) | ||
|
||
| Number | Description | Role | | ||
| --- | --- | --- | | ||
| 1 | Parent Directory Links. You can click on the name to navigate to the parent directories. | User | | ||
| 2 | Artist name. If you edit the artist name, the original name will be displayed in `( )`. | User | | ||
| 3 | Star. You can click on the star to add the artist to your favorites. | User | | ||
| 4 | Play. You can click on the play button to play all songs by the artist. | User | | ||
| 5 | Shuffle. You can click on the shuffle button to shuffle all songs by the artist. | User | | ||
| 6 | Add to player. You can click on the add to player button to add all songs by the artist to a player. | User | | ||
| 7 | Edit artist. You can click on the edit artist button to edit the artist name. | CoverArt | | ||
| 8 | Comment. You can click on the comment button to add a comment to the artist. | Comment | | ||
| 9 | List view. You can click on the list view button to switch to the list view. | User | | ||
| 10 | Grid view. You can click on the grid view button to switch to the grid view. | User | | ||
| 11 | Albums. You can see the albums by the artist. | User | | ||
| 12 | Artist Information. You can see the artist information from Last.fm. | User | | ||
|
||
### Edit Artist | ||
|
||
![webui-media-artist-edit](../figures/webui-media-artist-edit.png) | ||
|
||
1. Click on the edit artist button. | ||
2. Edit the artist name. | ||
3. Click on the save button. | ||
|
||
If you want to cancel, click on the Edit Artist button again. | ||
To update the search results, performing a library rescan is necessary, but a full scan is unnecessary. | ||
|
||
## Related Documentation | ||
|
||
- [Media/Rule](../media/rule.md) |
This file contains 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