forked from airsonic-advanced/airsonic-advanced
-
Notifications
You must be signed in to change notification settings - Fork 16
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 #479 from kagemomiji/issue325-lock-podcast-episode
#325 lock podcast episode
- Loading branch information
Showing
50 changed files
with
802 additions
and
125 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
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
73 changes: 73 additions & 0 deletions
73
airsonic-main/src/main/java/org/airsonic/player/command/PodcastChannelCommand.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,73 @@ | ||
/* | ||
* 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 | ||
* Copyright 2015 (C) Sindre Mehus | ||
*/ | ||
package org.airsonic.player.command; | ||
|
||
import org.airsonic.player.domain.PodcastChannel; | ||
import org.airsonic.player.domain.PodcastEpisode; | ||
import org.airsonic.player.domain.User; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class PodcastChannelCommand { | ||
|
||
private User user; | ||
private PodcastChannel channel; | ||
private List<PodcastEpisodeCommand> episodes = new ArrayList<>(); | ||
private boolean partyModeEnabled; | ||
|
||
public User getUser() { | ||
return user; | ||
} | ||
|
||
public void setUser(User user) { | ||
this.user = user; | ||
} | ||
|
||
public PodcastChannel getChannel() { | ||
return channel; | ||
} | ||
|
||
public void setChannel(PodcastChannel channel) { | ||
this.channel = channel; | ||
} | ||
|
||
public List<PodcastEpisodeCommand> getEpisodes() { | ||
return episodes; | ||
} | ||
|
||
public void setEpisodes(List<PodcastEpisodeCommand> episodes) { | ||
this.episodes = episodes; | ||
} | ||
|
||
public void setEpisodesByDAO(List<PodcastEpisode> episodes) { | ||
this.episodes = episodes.stream().map(PodcastEpisodeCommand::new).collect(Collectors.toList()); | ||
} | ||
|
||
public boolean isPartyModeEnabled() { | ||
return partyModeEnabled; | ||
} | ||
|
||
public void setPartyModeEnabled(boolean partyModeEnabled) { | ||
this.partyModeEnabled = partyModeEnabled; | ||
} | ||
|
||
} |
156 changes: 156 additions & 0 deletions
156
airsonic-main/src/main/java/org/airsonic/player/command/PodcastEpisodeCommand.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,156 @@ | ||
/* | ||
* 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.MediaFile; | ||
import org.airsonic.player.domain.PodcastEpisode; | ||
import org.airsonic.player.domain.PodcastStatus; | ||
|
||
import java.time.Instant; | ||
|
||
public class PodcastEpisodeCommand { | ||
|
||
private Integer id; | ||
|
||
private MediaFile mediaFile; | ||
|
||
private String title; | ||
|
||
private String description; | ||
|
||
private Instant publishDate; | ||
|
||
private String duration; | ||
|
||
private PodcastStatus status; | ||
|
||
private boolean locked; | ||
|
||
private Double completionRate; | ||
|
||
private String errorMessage; | ||
|
||
private boolean selected; | ||
|
||
public PodcastEpisodeCommand() { | ||
} | ||
|
||
public PodcastEpisodeCommand(PodcastEpisode episode) { | ||
this.id = episode.getId(); | ||
this.mediaFile = episode.getMediaFile(); | ||
this.title = episode.getTitle(); | ||
this.description = episode.getDescription(); | ||
this.publishDate = episode.getPublishDate(); | ||
this.duration = episode.getDuration(); | ||
this.status = episode.getStatus(); | ||
this.locked = episode.isLocked(); | ||
this.completionRate = episode.getCompletionRate(); | ||
this.errorMessage = episode.getErrorMessage(); | ||
this.selected = false; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Instant getPublishDate() { | ||
return publishDate; | ||
} | ||
|
||
public void setPublishDate(Instant publishDate) { | ||
this.publishDate = publishDate; | ||
} | ||
|
||
public String getDuration() { | ||
return duration; | ||
} | ||
|
||
public void setDuration(String duration) { | ||
this.duration = duration; | ||
} | ||
|
||
public Double getCompletionRate() { | ||
return completionRate; | ||
} | ||
|
||
public void setCompletionRate(Double completionRate) { | ||
this.completionRate = completionRate; | ||
} | ||
|
||
public PodcastStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(PodcastStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public String getErrorMessage() { | ||
return errorMessage; | ||
} | ||
|
||
public void setErrorMessage(String errorMessage) { | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
public MediaFile getMediaFile() { | ||
return mediaFile; | ||
} | ||
|
||
public void setMediaFile(MediaFile mediaFile) { | ||
this.mediaFile = mediaFile; | ||
} | ||
|
||
public boolean isLocked() { | ||
return locked; | ||
} | ||
|
||
public void setLocked(boolean locked) { | ||
this.locked = locked; | ||
} | ||
|
||
public boolean isSelected() { | ||
return selected; | ||
} | ||
|
||
public void setSelected(boolean selected) { | ||
this.selected = selected; | ||
} | ||
|
||
} |
Oops, something went wrong.