Skip to content

Commit

Permalink
Merge pull request #522 from kagemomiji/issue460-suppress-warn-cue-pa…
Browse files Browse the repository at this point in the history
…rser-warning-from-flac

#460 suppress warning of cue parser from FLAC
  • Loading branch information
kagemomiji committed Jun 25, 2024
2 parents d63fef4 + 1fc2de4 commit 50aefe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ private List<MediaFile> updateChildren(@Nonnull MediaFile parent) {
tracks.add(base);
return tracks.stream();
} else {
LOG.warn("Cue sheet file {} not found", filePath);
LOG.warn("Could not find base file '{}' for cue sheet {}", filePath, indexPath);
return Stream.empty();
}
}).collect(Collectors.toList());
Expand Down Expand Up @@ -1190,8 +1190,6 @@ private List<MediaFile> createIndexedTracks(@Nonnull MediaFile base, @Nullable C
double wholeFileLength = base.getDuration();

String basePath = base.getPath();
String file = cueSheet.getFileData().get(0).getFile();
LOG.info(file);
String parentPath = base.getParentPath();
String performer = cueSheet.getPerformer();
String albumName = cueSheet.getTitle();
Expand Down Expand Up @@ -1337,7 +1335,8 @@ public void setMemoryCacheEnabled(boolean memoryCacheEnabled) {
private CueSheet getCueSheet(@Nonnull Path cueFile) {
try {
CueSheet cueSheet = null;
switch (FilenameUtils.getExtension(cueFile.toString()).toLowerCase()) {
String ext = FilenameUtils.getExtension(cueFile.toString()).toLowerCase();
switch (ext) {
case "cue":
Charset cs = Charset.forName("UTF-8"); // default to UTF-8
// attempt to detect encoding for cueFile, fallback to UTF-8
Expand Down Expand Up @@ -1367,7 +1366,10 @@ private CueSheet getCueSheet(@Nonnull Path cueFile) {
}
// validation
if (cueSheet == null || cueSheet.getFileData() == null || cueSheet.getFileData().size() == 0) {
LOG.warn("Error parsing cuesheet {}", cueFile);
if ("cue".equals(ext)) {
// Warn if no file data found in cue sheet
LOG.warn("Error parsing cuesheet {}", cueFile);
}
return null;
}
return cueSheet;
Expand Down
2 changes: 1 addition & 1 deletion install/docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.1</version>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<stripClassifier>true</stripClassifier>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<java.version>17</java.version>
<cxf.version>4.0.4</cxf.version>
<snakeyaml.version>2.2</snakeyaml.version>
<lucene.version>9.10.0</lucene.version>
<lucene.version>9.11.0</lucene.version>
<docker.container.repo>ghcr.io/kagemomiji/airsonic-advanced</docker.container.repo>
<docker.java.version>17.0.10_7</docker.java.version>
</properties>
Expand Down Expand Up @@ -263,7 +263,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.22.0</version>
<version>3.23.0</version>
<executions>
<execution>
<id>validate</id>
Expand Down Expand Up @@ -304,7 +304,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<version>3.3.0</version>
<configuration>
<!-- #1186 Temporarily skip a test. -->
<excludes>
Expand Down Expand Up @@ -352,7 +352,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.1</version>
<executions>
<execution>
<id>init</id>
Expand Down

0 comments on commit 50aefe4

Please sign in to comment.