Set up initial configuration for installing
Set up player config for mobile control
This commit is contained in:
parent
551fb6d164
commit
2302dc0581
16 changed files with 1012 additions and 26 deletions
|
|
@ -1,9 +1,15 @@
|
|||
import json
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from dynamic_preferences.api import serializers
|
||||
from dynamic_preferences.api import viewsets as preferences_viewsets
|
||||
from dynamic_preferences.registries import global_preferences_registry
|
||||
from rest_framework import views
|
||||
from rest_framework.response import Response
|
||||
|
||||
from funkwhale_api.common import middleware
|
||||
from funkwhale_api.common import preferences
|
||||
from funkwhale_api.users.oauth import permissions as oauth_permissions
|
||||
|
||||
from . import nodeinfo
|
||||
|
|
@ -39,3 +45,23 @@ class NodeInfo(views.APIView):
|
|||
def get(self, request, *args, **kwargs):
|
||||
data = nodeinfo.get()
|
||||
return Response(data, status=200, content_type=NODEINFO_2_CONTENT_TYPE)
|
||||
|
||||
|
||||
class SpaManifest(views.APIView):
|
||||
permission_classes = []
|
||||
authentication_classes = []
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
existing_manifest = middleware.get_spa_file(
|
||||
settings.FUNKWHALE_SPA_HTML_ROOT, "manifest.json"
|
||||
)
|
||||
parsed_manifest = json.loads(existing_manifest)
|
||||
parsed_manifest["short_name"] = settings.APP_NAME
|
||||
instance_name = preferences.get("instance__name")
|
||||
if instance_name:
|
||||
parsed_manifest["short_name"] = instance_name
|
||||
parsed_manifest["name"] = instance_name
|
||||
instance_description = preferences.get("instance__short_description")
|
||||
if instance_description:
|
||||
parsed_manifest["description"] = instance_description
|
||||
return Response(parsed_manifest, status=200)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue