Backend (Django 6.1 + DRF): - Token auth with a custom User model (register/login/logout/me) - Library models (MediaItem, MediaLocation) and REST endpoints - File list/detail with search, rating filter, sorting, pagination - Multipart upload with optional rating/tags/notes - Range-aware media serving (video seeking) and ffmpeg thumbnails - scan_files management command for the watched folder Frontend (React 19 + Vite + TypeScript): - Catppuccin Mocha design tokens from the design docs - App shell, token persistence, protected routes - Library grid with filters, file detail with custom data editor - Upload page with per-file progress via XHR - Dev proxy to the Django API
24 lines
611 B
Python
24 lines
611 B
Python
from django.contrib import admin
|
|
|
|
from .models import MediaItem, MediaLocation
|
|
|
|
|
|
class MediaLocationInline(admin.TabularInline):
|
|
model = MediaLocation
|
|
extra = 0
|
|
readonly_fields = ("path", "rel_path", "mtime")
|
|
|
|
|
|
@admin.register(MediaItem)
|
|
class MediaItemAdmin(admin.ModelAdmin):
|
|
list_display = ("md5", "size", "rating", "created_at")
|
|
list_filter = ("rating",)
|
|
search_fields = ("md5",)
|
|
inlines = [MediaLocationInline]
|
|
|
|
|
|
@admin.register(MediaLocation)
|
|
class MediaLocationAdmin(admin.ModelAdmin):
|
|
list_display = ("rel_path", "item", "mtime")
|
|
search_fields = ("rel_path", "path")
|