Skip to content

Commit

Permalink
Merge pull request #479 from kagemomiji/issue325-lock-podcast-episode
Browse files Browse the repository at this point in the history
#325 lock podcast episode
  • Loading branch information
kagemomiji committed May 24, 2024
2 parents 7939edd + a967588 commit a1c8c3a
Show file tree
Hide file tree
Showing 50 changed files with 802 additions and 125 deletions.
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.20.0
uses: aquasecurity/trivy-action@0.21.0
with:
scan-type: 'fs'
format: 'sarif'
Expand Down
6 changes: 3 additions & 3 deletions airsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.1</version>
<version>1.26.2</version>
</dependency>
<dependency>
<!-- compression library-->
Expand Down Expand Up @@ -282,7 +282,7 @@
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>4.0.2</version>
<version>4.0.3</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -591,7 +591,7 @@
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.3.0</version>
<version>8.4.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
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;
}

}
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;
}

}
Loading

0 comments on commit a1c8c3a

Please sign in to comment.