|
@@ -39,8 +39,6 @@ const { socket } = useWebsocketsStore();
|
|
const stationStore = useStationStore();
|
|
const stationStore = useStationStore();
|
|
const userPreferencesStore = useUserPreferencesStore();
|
|
const userPreferencesStore = useUserPreferencesStore();
|
|
|
|
|
|
-const { autoSkipDisliked } = storeToRefs(userPreferencesStore);
|
|
|
|
-
|
|
|
|
const tab = ref("current");
|
|
const tab = ref("current");
|
|
const search = reactive({
|
|
const search = reactive({
|
|
query: "",
|
|
query: "",
|
|
@@ -65,8 +63,10 @@ const {
|
|
} = useSortablePlaylists();
|
|
} = useSortablePlaylists();
|
|
|
|
|
|
const { experimental } = storeToRefs(configStore);
|
|
const { experimental } = storeToRefs(configStore);
|
|
|
|
+const { autoSkipDisliked } = storeToRefs(userPreferencesStore);
|
|
|
|
|
|
-const { autoRequest, history, songsList } = storeToRefs(stationStore);
|
|
|
|
|
|
+const { autoRequest, autorequestExcludedMediaSources } =
|
|
|
|
+ storeToRefs(stationStore);
|
|
|
|
|
|
const manageStationStore = useManageStationStore({
|
|
const manageStationStore = useManageStationStore({
|
|
modalUuid: props.modalUuid
|
|
modalUuid: props.modalUuid
|
|
@@ -98,60 +98,12 @@ const blacklist = computed({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-const dislikedPlaylist = computed(() =>
|
|
|
|
- playlists.value.find(playlist => playlist.type === "user-disliked")
|
|
|
|
-);
|
|
|
|
-
|
|
|
|
const resultsLeftCount = computed(() => search.count - search.results.length);
|
|
const resultsLeftCount = computed(() => search.count - search.results.length);
|
|
|
|
|
|
const nextPageResultsCount = computed(() =>
|
|
const nextPageResultsCount = computed(() =>
|
|
Math.min(search.pageSize, resultsLeftCount.value)
|
|
Math.min(search.pageSize, resultsLeftCount.value)
|
|
);
|
|
);
|
|
|
|
|
|
-// List of media sources that will not be allowed to be autorequested
|
|
|
|
-const excludedMediaSources = computed(() => {
|
|
|
|
- const mediaSources = new Set();
|
|
|
|
-
|
|
|
|
- // Exclude the current song
|
|
|
|
- if (station.value.currentSong)
|
|
|
|
- mediaSources.add(station.value.currentSong.mediaSource);
|
|
|
|
-
|
|
|
|
- // Exclude songs in the queue
|
|
|
|
- if (songsList.value) {
|
|
|
|
- songsList.value.forEach(song => {
|
|
|
|
- mediaSources.add(song.mediaSource);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // If auto skip disliked preference is enabled, exclude all songs in the disliked playlist
|
|
|
|
- if (autoSkipDisliked.value && dislikedPlaylist.value) {
|
|
|
|
- dislikedPlaylist.value.songs.forEach(song => {
|
|
|
|
- mediaSources.add(song.mediaSource);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // If no history exists, just stop here
|
|
|
|
- if (!history.value) Array.from(mediaSources);
|
|
|
|
-
|
|
|
|
- const {
|
|
|
|
- autorequestDisallowRecentlyPlayedEnabled,
|
|
|
|
- autorequestDisallowRecentlyPlayedNumber
|
|
|
|
- } = station.value.requests;
|
|
|
|
-
|
|
|
|
- // If the station is set to disallow recently played songs, and station history is enabled, exclude the last X history songs
|
|
|
|
- if (
|
|
|
|
- autorequestDisallowRecentlyPlayedEnabled &&
|
|
|
|
- experimental.value.station_history
|
|
|
|
- ) {
|
|
|
|
- history.value.forEach((historyItem, index) => {
|
|
|
|
- if (index < autorequestDisallowRecentlyPlayedNumber)
|
|
|
|
- mediaSources.add(historyItem.payload.song.mediaSource);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return Array.from(mediaSources);
|
|
|
|
-});
|
|
|
|
-
|
|
|
|
const totalUniqueAutorequestableMediaSources = computed<string[]>(() => {
|
|
const totalUniqueAutorequestableMediaSources = computed<string[]>(() => {
|
|
if (!autoRequest.value) return [];
|
|
if (!autoRequest.value) return [];
|
|
|
|
|
|
@@ -167,7 +119,7 @@ const totalUniqueAutorequestableMediaSources = computed<string[]>(() => {
|
|
});
|
|
});
|
|
|
|
|
|
const actuallyAutorequestingMediaSources = computed(() => {
|
|
const actuallyAutorequestingMediaSources = computed(() => {
|
|
- const excluded = excludedMediaSources.value;
|
|
|
|
|
|
+ const excluded = autorequestExcludedMediaSources.value;
|
|
const remaining = totalUniqueAutorequestableMediaSources.value.filter(
|
|
const remaining = totalUniqueAutorequestableMediaSources.value.filter(
|
|
mediaSource => {
|
|
mediaSource => {
|
|
if (excluded.indexOf(mediaSource) !== -1) return false;
|
|
if (excluded.indexOf(mediaSource) !== -1) return false;
|
|
@@ -880,6 +832,10 @@ onMounted(() => {
|
|
autorequested. Spotify
|
|
autorequested. Spotify
|
|
<span v-if="!experimental.soundcloud">and SoundCloud</span>
|
|
<span v-if="!experimental.soundcloud">and SoundCloud</span>
|
|
songs will also not be autorequested.
|
|
songs will also not be autorequested.
|
|
|
|
+ <span v-if="autoSkipDisliked"
|
|
|
|
+ >Disliked songs will also not be autorequested due to
|
|
|
|
+ your preferences.</span
|
|
|
|
+ >
|
|
|
|
|
|
<br />
|
|
<br />
|
|
<br />
|
|
<br />
|
|
@@ -1060,13 +1016,31 @@ onMounted(() => {
|
|
'blacklist'
|
|
'blacklist'
|
|
)
|
|
)
|
|
"
|
|
"
|
|
- @click="selectPlaylist(element)"
|
|
|
|
- class="material-icons play-icon"
|
|
|
|
- :content="`${label(
|
|
|
|
- 'future',
|
|
|
|
- null,
|
|
|
|
- true
|
|
|
|
- )} songs from this playlist`"
|
|
|
|
|
|
+ :class="{
|
|
|
|
+ 'play-icon':
|
|
|
|
+ type !== 'autorequest' ||
|
|
|
|
+ !autoSkipDisliked ||
|
|
|
|
+ element.type !== 'user-disliked'
|
|
|
|
+ }"
|
|
|
|
+ @click="
|
|
|
|
+ type !== 'autorequest' ||
|
|
|
|
+ !autoSkipDisliked ||
|
|
|
|
+ element.type !== 'user-disliked'
|
|
|
|
+ ? selectPlaylist(element)
|
|
|
|
+ : null
|
|
|
|
+ "
|
|
|
|
+ class="material-icons"
|
|
|
|
+ :content="
|
|
|
|
+ type !== 'autorequest' ||
|
|
|
|
+ !autoSkipDisliked ||
|
|
|
|
+ element.type !== 'user-disliked'
|
|
|
|
+ ? `${label(
|
|
|
|
+ 'future',
|
|
|
|
+ null,
|
|
|
|
+ true
|
|
|
|
+ )} songs from this playlist`
|
|
|
|
+ : 'Your preferences are set to skip disliked songs'
|
|
|
|
+ "
|
|
v-tippy
|
|
v-tippy
|
|
>play_arrow</i
|
|
>play_arrow</i
|
|
>
|
|
>
|