Compare commits

..

No commits in common. "develop" and "2.0.0-alpha.2" have entirely different histories.

14 changed files with 13 additions and 4845 deletions

View File

@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: Funkwhale API
version: 2.0.0a2
version: 2.0.0a1
description: |
# Funkwhale API

View File

@ -1,5 +1,3 @@
import os
import pathlib
import urllib.parse
from django import urls
@ -905,17 +903,13 @@ class FSImportSerializer(serializers.Serializer):
prune = serializers.BooleanField(required=False, default=True)
outbox = serializers.BooleanField(required=False, default=False)
broadcast = serializers.BooleanField(required=False, default=False)
replace = serializers.BooleanField(required=False, default=False)
batch_size = serializers.IntegerField(required=False, default=1000)
verbosity = serializers.IntegerField(required=False, default=1)
def validate_path(self, value):
try:
utils.browse_dir(settings.MUSIC_DIRECTORY_PATH, value)
except NotADirectoryError:
if not os.path.isfile(pathlib.Path(settings.MUSIC_DIRECTORY_PATH) / value):
raise serializers.ValidationError("Invalid path")
except (FileNotFoundError, ValueError):
except (NotADirectoryError, FileNotFoundError, ValueError):
raise serializers.ValidationError("Invalid path")
return value

View File

@ -1209,7 +1209,6 @@ def fs_import(
prune=True,
outbox=False,
broadcast=False,
replace=False,
batch_size=1000,
verbosity=1,
):
@ -1230,7 +1229,7 @@ def fs_import(
"batch_size": batch_size,
"async_": False,
"prune": prune,
"replace": replace,
"replace": False,
"verbosity": verbosity,
"exit_on_failure": False,
"outbox": outbox,

View File

@ -386,7 +386,6 @@ class LibraryViewSet(
prune=serializer.validated_data["prune"],
outbox=serializer.validated_data["outbox"],
broadcast=serializer.validated_data["broadcast"],
replace=serializer.validated_data["replace"],
batch_size=serializer.validated_data["batch_size"],
verbosity=serializer.validated_data["verbosity"],
)

View File

@ -143,7 +143,7 @@ class PlaylistViewSet(
# Apply pagination
paginator = PageNumberPagination()
paginator.page_size = 50 # Set the page size (number of items per page)
paginator.page_size = 100 # Set the page size (number of items per page)
paginated_plts = paginator.paginate_queryset(plts, request)
# Serialize the paginated data

View File

@ -135,8 +135,7 @@ build-backend = "poetry.core.masonry.api"
[tool.pylint.master]
load-plugins = ["pylint_django"]
django-settings-module = "config.settings.local"
init-hook = 'import os; os.environ.setdefault("FUNKWHALE_URL", "https://test.federation")'
django-settings-module = "config.settings.testing"
[tool.pylint.messages_control]
disable = [

View File

@ -1528,7 +1528,6 @@ def test_fs_import_post(
prune=True,
outbox=False,
broadcast=False,
replace=False,
batch_size=1000,
verbosity=1,
)

View File

@ -1 +0,0 @@
Allow importing single files using fs-import API endpoint

View File

@ -58,8 +58,6 @@ Once we're ready to release a new version of the software, we can use the follow
7. Update the next release version
```sh
docker compose build api
docker compose run --rm api funkwhale-manage spectacular > ./api/funkwhale_api/common/schema.yml
cd api
poetry version "$NEXT_RELEASE"
cd ..

View File

@ -45,7 +45,7 @@ interface Props {
paginateResults?: boolean
total?: number
page?: number
paginateBy?: number
paginateBy?: number,
unique?: boolean
}

View File

@ -27,14 +27,6 @@ const soundCache = new LRUCache<number, Sound>({
dispose: (sound) => sound.dispose()
})
// used to make soundCache reactive
const soundCacheVersion = ref(0)
function setSoundCache(trackId: number, sound: Sound) {
soundCache.set(trackId, sound)
soundCacheVersion.value++ // bump to trigger reactivity
}
const currentTrack = ref<QueueTrack>()
export const fetchTrackSources = async (id: number): Promise<QueueTrackSource[]> => {
@ -147,7 +139,7 @@ export const useTracks = createGlobalState(() => {
}
// Add track to the sound cache and remove from the promise cache
setSoundCache(track.id, sound)
soundCache.set(track.id, sound)
soundPromises.delete(track.id)
return sound
@ -232,12 +224,7 @@ export const useTracks = createGlobalState(() => {
})
})
const currentSound = computed(() => {
soundCacheVersion.value //trigger reactivity
const trackId = currentTrack.value?.id ?? -1
const sound = soundCache.get(trackId)
return sound
})
const currentSound = computed(() => soundCache.get(currentTrack.value?.id ?? -1))
const clearCache = () => {
return soundCache.clear()

View File

@ -4611,8 +4611,5 @@
"title": "Радио"
}
}
},
"vui": {
"radio": "Радио"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -96,19 +96,20 @@ const loadMoreTracks = async () => {
if (nextPage.value) {
isLoadingMoreTracks.value = true; // Set loading state for the button
try {
const response = await axios.get(nextPage.value)
const response = await axios.get(nextPage.value);
// Append new tracks to the existing list
fullPlaylistTracks.value = [...fullPlaylistTracks.value, ...response.data.results]
fullPlaylistTracks.value = [...fullPlaylistTracks.value, ...response.data.results];
// Update pagination metadata
nextPage.value = response.data.next
nextPage.value = response.data.next;
} catch (error) {
useErrorHandler(error as Error)
} finally {
isLoadingMoreTracks.value = false; // Reset loading state
}
}
}
};
fetchData()