diff --git a/DEV_MODE.ini b/DEV_MODE.ini deleted file mode 100644 index e35c974..0000000 --- a/DEV_MODE.ini +++ /dev/null @@ -1,33 +0,0 @@ -####################################################################################################### -# Developer Settings -####################################################################################################### -# DISABLE_CACHE -# No albums or artists are ever added to the cache, meaning releases will be rediscovered -# during every crawl and classified as new. This will also not prevent these albums getting -# added to the target playlists over and over again. -# -# DISABLE_PLAYLIST_ADDITIONS -# Newly discovered releases will not be added to any target playlists. They will still be marked -# with a notifier though and the "Last Search" description will still be set. -# -# DISABLE_NOTIFICATION_MARKERS -# The black and white circles of the target playlists will not be modified under any circumstance. -# -# DISABLE_SCHEDULED_CRAWLS -# Scheduled crawls that run once every half hour will be completely disabled. Only manual calls -# at /crawl will be executed. -# -# DISABLE_INITIAL_CRAWL -# The initial crawl when first starting the bot will be skipped entirely. -# -# DISABLE_RELAY -# Relaying releases will be skipped even when a config file exists. -# -####################################################################################################### - -#DISABLE_CACHE -#DISABLE_PLAYLIST_ADDITIONS -#DISABLE_NOTIFICATION_MARKERS -#DISABLE_SCHEDULED_CRAWLS -#DISABLE_INITIAL_CRAWL -#DISABLE_RELAY diff --git a/src/main/java/spotify/bot/properties/FeatureControl.java b/src/main/java/spotify/bot/properties/FeatureControl.java index 4def552..f8f7b28 100644 --- a/src/main/java/spotify/bot/properties/FeatureControl.java +++ b/src/main/java/spotify/bot/properties/FeatureControl.java @@ -40,6 +40,9 @@ public class FeatureControl { @Value("${spotify.discovery.crawl.feature.auto_purger:#{true}}") private boolean enableAutoPurger; + @Value("${spotify.discovery.crawl.feature.auto_clear_notifications:#{true}}") + private boolean autoClearNotifications; + private final DiscoveryBotLogger logger; FeatureControl(DiscoveryBotLogger logger) { @@ -93,4 +96,8 @@ public boolean isForwarderEnabled() { public boolean isAutoPurgeEnabled() { return enableAutoPurger; } + + public boolean isAutoClearNotifications() { + return autoClearNotifications; + } } \ No newline at end of file diff --git a/src/main/java/spotify/bot/service/CachedArtistService.java b/src/main/java/spotify/bot/service/CachedArtistService.java index ec12718..e683bc4 100644 --- a/src/main/java/spotify/bot/service/CachedArtistService.java +++ b/src/main/java/spotify/bot/service/CachedArtistService.java @@ -59,7 +59,7 @@ public CachedArtistsContainer getFollowedArtistsIds() throws SQLException, Illeg List newFollowedArtists = followedArtist.stream() .filter(a -> !cachedArtists.contains(a.getId())) .collect(Collectors.toList()); - List newFollowedArtistsIds = followedArtist.stream() + List newFollowedArtistsIds = newFollowedArtists.stream() .map(Artist::getId) .collect(Collectors.toList()); diff --git a/src/main/java/spotify/bot/service/DiscoveryAlbumService.java b/src/main/java/spotify/bot/service/DiscoveryAlbumService.java index f5b9995..d551e73 100644 --- a/src/main/java/spotify/bot/service/DiscoveryAlbumService.java +++ b/src/main/java/spotify/bot/service/DiscoveryAlbumService.java @@ -65,7 +65,7 @@ public List getAllAlbumsOfArtists(List followedArtists, results.addAll(albumIdsOfSingleArtist); if (showProgress) { done++; - log.info(done + " / " + followedArtists.size()); + log.debug(done + " / " + followedArtists.size()); } } return results; diff --git a/src/main/java/spotify/controller/MiscController.java b/src/main/java/spotify/controller/MiscController.java index 4006f64..2faf3dd 100644 --- a/src/main/java/spotify/controller/MiscController.java +++ b/src/main/java/spotify/controller/MiscController.java @@ -47,7 +47,7 @@ public class MiscController implements SchedulingConfigurer { @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { - if (featureControl.isPlaylistMetaEnabled()) { + if (featureControl.isAutoClearNotifications() && featureControl.isPlaylistMetaEnabled()) { taskRegistrar.addFixedDelayTask(this::clearNewIndicatorScheduler, CLEAR_NOTIFIERS_INTERVAL); } } diff --git a/templates/application.properties b/templates/application.properties index 12fac62..50f8dd0 100644 --- a/templates/application.properties +++ b/templates/application.properties @@ -38,3 +38,4 @@ #spotify.discovery.crawl.feature.initial_crawl = false #spotify.discovery.crawl.feature.forwarder = false #spotify.discovery.crawl.feature.auto_purger = false +#spotify.discovery.crawl.feature.auto_clear_notifications = false