2018-05-28 22:07:20 +00:00
|
|
|
from django.conf.urls import include, url
|
2019-07-02 12:31:47 +00:00
|
|
|
from funkwhale_api.common import routers
|
2018-06-09 13:36:16 +00:00
|
|
|
|
2018-06-10 08:55:16 +00:00
|
|
|
from . import views
|
|
|
|
|
2019-07-02 12:31:47 +00:00
|
|
|
federation_router = routers.OptionalSlashRouter()
|
2018-12-26 22:03:27 +00:00
|
|
|
federation_router.register(r"domains", views.ManageDomainViewSet, "domains")
|
2019-01-07 08:45:53 +00:00
|
|
|
|
2019-07-02 12:31:47 +00:00
|
|
|
library_router = routers.OptionalSlashRouter()
|
2019-04-17 12:17:59 +00:00
|
|
|
library_router.register(r"albums", views.ManageAlbumViewSet, "albums")
|
2019-04-19 10:05:13 +00:00
|
|
|
library_router.register(r"artists", views.ManageArtistViewSet, "artists")
|
|
|
|
library_router.register(r"libraries", views.ManageLibraryViewSet, "libraries")
|
2019-04-17 12:17:59 +00:00
|
|
|
library_router.register(r"tracks", views.ManageTrackViewSet, "tracks")
|
2019-04-19 10:05:13 +00:00
|
|
|
library_router.register(r"uploads", views.ManageUploadViewSet, "uploads")
|
2019-01-07 08:45:53 +00:00
|
|
|
|
2019-07-02 12:31:47 +00:00
|
|
|
moderation_router = routers.OptionalSlashRouter()
|
2019-01-07 08:45:53 +00:00
|
|
|
moderation_router.register(
|
|
|
|
r"instance-policies", views.ManageInstancePolicyViewSet, "instance-policies"
|
|
|
|
)
|
2019-08-26 13:27:21 +00:00
|
|
|
moderation_router.register(r"reports", views.ManageReportViewSet, "reports")
|
2020-03-18 10:57:33 +00:00
|
|
|
moderation_router.register(r"requests", views.ManageUserRequestViewSet, "requests")
|
2019-08-29 09:45:41 +00:00
|
|
|
moderation_router.register(r"notes", views.ManageNoteViewSet, "notes")
|
2019-01-07 08:45:53 +00:00
|
|
|
|
2019-07-02 12:31:47 +00:00
|
|
|
users_router = routers.OptionalSlashRouter()
|
2018-06-19 16:48:43 +00:00
|
|
|
users_router.register(r"users", views.ManageUserViewSet, "users")
|
2018-06-19 21:27:21 +00:00
|
|
|
users_router.register(r"invitations", views.ManageInvitationViewSet, "invitations")
|
2018-05-28 22:07:20 +00:00
|
|
|
|
2019-07-02 12:31:47 +00:00
|
|
|
other_router = routers.OptionalSlashRouter()
|
2019-01-03 10:47:29 +00:00
|
|
|
other_router.register(r"accounts", views.ManageActorViewSet, "accounts")
|
2020-03-31 08:45:41 +00:00
|
|
|
other_router.register(r"channels", views.ManageChannelViewSet, "channels")
|
2019-07-24 08:24:30 +00:00
|
|
|
other_router.register(r"tags", views.ManageTagViewSet, "tags")
|
2019-01-03 10:47:29 +00:00
|
|
|
|
2018-05-28 22:07:20 +00:00
|
|
|
urlpatterns = [
|
2018-12-26 22:03:27 +00:00
|
|
|
url(
|
|
|
|
r"^federation/",
|
|
|
|
include((federation_router.urls, "federation"), namespace="federation"),
|
|
|
|
),
|
2018-06-19 16:48:43 +00:00
|
|
|
url(r"^library/", include((library_router.urls, "instance"), namespace="library")),
|
2019-01-07 08:45:53 +00:00
|
|
|
url(
|
|
|
|
r"^moderation/",
|
|
|
|
include((moderation_router.urls, "moderation"), namespace="moderation"),
|
|
|
|
),
|
2018-06-19 16:48:43 +00:00
|
|
|
url(r"^users/", include((users_router.urls, "instance"), namespace="users")),
|
2019-01-03 10:47:29 +00:00
|
|
|
] + other_router.urls
|