Skip to content

Commit

Permalink
#407 fix playlist cache problem
Browse files Browse the repository at this point in the history
  • Loading branch information
kagemomiji committed Mar 30, 2024
1 parent 85870a8 commit 3f9e58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public List<MediaFile> getFilesInPlaylist(int id, boolean includeNotPresent) {
LOG.warn("Playlist {} not found", id);
return new ArrayList<>();
}
).stream().filter(x -> includeNotPresent || x.isPresent()).collect(Collectors.toList());
).stream().filter(x -> x.isPresent() || includeNotPresent).collect(Collectors.toList());
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.airsonic.player.domain.Playlist;
import org.airsonic.player.domain.User;
import org.airsonic.player.domain.UserSettings;
import org.airsonic.player.service.cache.PlaylistCache.PlaylistUserList;
import org.ehcache.config.builders.CacheConfigurationBuilder;
import org.ehcache.config.builders.ConfigurationBuilder;
import org.ehcache.config.builders.ExpiryPolicyBuilder;
Expand Down Expand Up @@ -97,7 +98,7 @@ private org.ehcache.config.Configuration createConfig(final ClassLoader cl) {
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofDays(10)))
.withService(cacheLogging))
.withCache(PLAYLIST_USERS_CACHE,
CacheConfigurationBuilder.newCacheConfigurationBuilder(Integer.class, Object.class, pools)
CacheConfigurationBuilder.newCacheConfigurationBuilder(Integer.class, PlaylistUserList.class, pools)
.withClassLoader(cl)
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofDays(10)))
.withService(cacheLogging))
Expand Down

0 comments on commit 3f9e58b

Please sign in to comment.