Skip to content

Commit

Permalink
Merge v14 into v14-tmdb-changes
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/java/net/pms/external/umsapi/APIUtils.java
  • Loading branch information
SurfaceS committed Oct 21, 2023
2 parents e0b11e3 + 76d2d8d commit 728f0d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/pms/configuration/BaseConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean getBoolean(String key, boolean def) {
return configurationReader.getBoolean(key, def);
}

public String getString(String key, String def) {
public final String getString(String key, String def) {
return configurationReader.getNonBlankConfigurationString(key, def);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ public static VideoMetadataLocalized getVideoMetadataUnLocalized(final Connectio
return null;
}


/**
* Checks whether the latest data from our API has been written to the
* database for this video.
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/pms/external/umsapi/APIUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,16 @@ public static void backgroundLookupAndAddMetadata(final File file, final MediaIn

if (isTVEpisode) {
Long tvSeriesId = setTVSeriesInfo(connection, titleFromFilename, tvSeriesStartYear, titleSimplifiedFromFilename, file, media, seriesIMDbIDFromAPI, tmdbTvIDFromAPI);
if (tvSeriesId != null) {
videoMetadata.setTvSeriesId(tvSeriesId);
TvSeriesMetadata tvSeriesMetadata = MediaTableTVSeries.getTvSeriesMetadata(connection, tvSeriesId);
videoMetadata.setSeriesMetadata(tvSeriesMetadata);
videoMetadata.setTmdbTvId(tvSeriesMetadata.getTmdbId());
}
if (isNotBlank(titleFromAPI)) {
LOGGER.trace("Setting episode name from api: " + titleFromAPI);
videoMetadata.setTitle(titleFromAPI);
}
videoMetadata.setTmdbTvId(tvSeriesMetadata.getTmdbId());
videoMetadata.setTvSeason(tvSeasonFromAPI);
videoMetadata.setTvEpisodeNumber(tvEpisodeNumberFromAPI);
videoMetadata.setIsTvEpisode(true);
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/net/pms/store/StoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,14 @@ protected void sortChildrenIfNeeded(String lang) {
if (!child1.isSortableByDisplayName || !child2.isSortableByDisplayName) {
return 0;
}
String str1 = Normalizer.normalize(child1.getLocalizedDisplayName(lang), Normalizer.Form.NFKD);
String str2 = Normalizer.normalize(child2.getLocalizedDisplayName(lang), Normalizer.Form.NFKD);
String str1 = child1.getLocalizedDisplayName(lang);
String str2 = child2.getLocalizedDisplayName(lang);
if (PMS.getConfiguration().isIgnoreTheWordAandThe()) {
str1 = str1.replaceAll("^(?i)A[ .]|The[ .]", "").replaceAll("\\s{2,}", " ");
str2 = str2.replaceAll("^(?i)A[ .]|The[ .]", "").replaceAll("\\s{2,}", " ");
}
str1 = Normalizer.normalize(str1, Normalizer.Form.NFKD);
str2 = Normalizer.normalize(str2, Normalizer.Form.NFKD);
return str1.compareToIgnoreCase(str2);
});
}
Expand Down

0 comments on commit 728f0d4

Please sign in to comment.