2022-12-15 17:29:35 -05:00
|
|
|
from django.urls import path, re_path
|
2023-08-10 11:27:31 -04:00
|
|
|
|
2022-12-16 01:08:10 -05:00
|
|
|
from .models import *
|
2023-08-10 11:27:31 -04:00
|
|
|
from .views import *
|
2022-12-16 01:08:10 -05:00
|
|
|
|
2022-12-29 23:57:02 -05:00
|
|
|
app_name = "catalog"
|
2022-12-24 01:28:24 -05:00
|
|
|
|
2022-12-16 01:08:10 -05:00
|
|
|
|
|
|
|
def _get_all_url_paths():
|
2022-12-29 23:57:02 -05:00
|
|
|
paths = ["item"]
|
2022-12-16 01:08:10 -05:00
|
|
|
for cls in Item.__subclasses__():
|
2022-12-29 23:57:02 -05:00
|
|
|
p = getattr(cls, "url_path", None)
|
2022-12-16 01:08:10 -05:00
|
|
|
if p:
|
|
|
|
paths.append(p)
|
|
|
|
res = "|".join(paths)
|
|
|
|
return res
|
2022-12-15 17:29:35 -05:00
|
|
|
|
2022-12-07 19:09:05 -05:00
|
|
|
|
|
|
|
urlpatterns = [
|
2022-12-29 23:57:02 -05:00
|
|
|
re_path(
|
2023-01-05 03:06:13 -05:00
|
|
|
r"^item/(?P<item_uid>[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})$",
|
2022-12-29 23:57:02 -05:00
|
|
|
retrieve_by_uuid,
|
|
|
|
name="retrieve_by_uuid",
|
|
|
|
),
|
2023-02-10 15:56:13 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/embed$",
|
|
|
|
embed,
|
|
|
|
name="embed",
|
|
|
|
),
|
2022-12-29 23:57:02 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})$",
|
|
|
|
retrieve,
|
|
|
|
name="retrieve",
|
|
|
|
),
|
2023-12-25 11:05:09 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/$",
|
|
|
|
retrieve_redirect,
|
|
|
|
name="retrieve_redirect",
|
|
|
|
),
|
2023-02-01 22:40:34 -05:00
|
|
|
path("podcast/<str:item_uuid>/episodes", episode_data, name="episode_data"),
|
2023-01-05 03:06:13 -05:00
|
|
|
path("catalog/create/<str:item_model>", create, name="create"),
|
2023-06-19 12:30:39 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/history$",
|
|
|
|
history,
|
|
|
|
name="history",
|
|
|
|
),
|
2023-01-01 23:50:57 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/edit$",
|
|
|
|
edit,
|
|
|
|
name="edit",
|
|
|
|
),
|
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/delete$",
|
|
|
|
delete,
|
|
|
|
name="delete",
|
|
|
|
),
|
2023-01-07 00:35:30 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
2023-05-13 15:11:05 -04:00
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/assign_parent$",
|
|
|
|
assign_parent,
|
|
|
|
name="assign_parent",
|
|
|
|
),
|
2023-06-12 15:07:55 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/remove_unused_seasons$",
|
|
|
|
remove_unused_seasons,
|
|
|
|
name="remove_unused_seasons",
|
|
|
|
),
|
2023-06-16 17:47:22 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/fetch_tvepisodes$",
|
|
|
|
fetch_tvepisodes,
|
|
|
|
name="fetch_tvepisodes",
|
|
|
|
),
|
2024-01-27 15:21:30 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/suggest$",
|
|
|
|
suggest,
|
|
|
|
name="suggest",
|
|
|
|
),
|
2023-05-13 15:11:05 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
2023-01-07 00:35:30 -05:00
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/merge$",
|
|
|
|
merge,
|
|
|
|
name="merge",
|
|
|
|
),
|
2024-04-09 00:45:40 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/link_edition$",
|
|
|
|
link_edition,
|
|
|
|
name="link_edition",
|
|
|
|
),
|
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/unlink_works$",
|
|
|
|
unlink_works,
|
|
|
|
name="unlink_works",
|
|
|
|
),
|
2023-01-23 21:24:31 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/recast$",
|
|
|
|
recast,
|
|
|
|
name="recast",
|
|
|
|
),
|
2023-05-20 11:01:18 -04:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
2023-06-16 17:47:22 -04:00
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/comments_by_episode$",
|
|
|
|
comments_by_episode,
|
|
|
|
name="comments_by_episode",
|
|
|
|
),
|
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/comments$",
|
2023-05-20 11:01:18 -04:00
|
|
|
comments,
|
|
|
|
name="comments",
|
|
|
|
),
|
2022-12-29 23:57:02 -05:00
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/reviews",
|
2023-05-20 11:01:18 -04:00
|
|
|
reviews,
|
|
|
|
name="reviews",
|
|
|
|
),
|
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/review_list",
|
2022-12-29 23:57:02 -05:00
|
|
|
review_list,
|
|
|
|
name="review_list",
|
|
|
|
),
|
|
|
|
re_path(
|
|
|
|
r"^(?P<item_path>"
|
|
|
|
+ _get_all_url_paths()
|
|
|
|
+ ")/(?P<item_uuid>[A-Za-z0-9]{21,22})/marks(?:/(?P<following_only>\\w+))?",
|
|
|
|
mark_list,
|
|
|
|
name="mark_list",
|
|
|
|
),
|
2023-07-20 21:59:49 -04:00
|
|
|
path("search/", search, name="search_legacy"),
|
|
|
|
path("search/external", external_search, name="external_search"),
|
2022-12-31 11:06:23 -05:00
|
|
|
path("fetch_refresh/<str:job_id>", fetch_refresh, name="fetch_refresh"),
|
2023-01-05 03:06:13 -05:00
|
|
|
path("refetch", refetch, name="refetch"),
|
2023-01-23 16:31:30 -05:00
|
|
|
path("unlink", unlink, name="unlink"),
|
2023-04-19 22:31:27 -04:00
|
|
|
path("discover/", discover, name="discover"),
|
2022-12-07 19:09:05 -05:00
|
|
|
]
|