[admin] Use raw ids where possible and simplify scrobble inlines
All checks were successful
build / test (push) Successful in 1m55s
All checks were successful
build / test (push) Successful in 1m55s
This commit is contained in:
50
PROJECT.org
50
PROJECT.org
@ -88,8 +88,8 @@ fetching and simple saving.
|
|||||||
*** Metadata sources
|
*** Metadata sources
|
||||||
**** Scraper
|
**** Scraper
|
||||||
|
|
||||||
* Backlog [0/16] :vrobbler:project:personal:
|
* Backlog [3/19] :vrobbler:project:personal:
|
||||||
** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :vrobbler:personal:bug:music:scrobbles:
|
** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :bug:music:scrobbles:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 702462cf-d54b-48c6-8a7c-78b8de751deb
|
:ID: 702462cf-d54b-48c6-8a7c-78b8de751deb
|
||||||
:END:
|
:END:
|
||||||
@ -387,11 +387,11 @@ fetching and simple saving.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
** TODO [#C] User should be able to enable auto trail tracking via amail reader with Garmin LiveTrack URLs :vrobbler:trails:project:feature:personal:
|
** TODO [#C] Allow auto trail tracking via email with Garmin LiveTrack URLs :trails:feature:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 133bcf71-078f-4efa-a029-1eae4b4d146d
|
:ID: 133bcf71-078f-4efa-a029-1eae4b4d146d
|
||||||
:END:
|
:END:
|
||||||
** TODO [#C] Fix exporting so it works reliably :exporting:project:feature:
|
** TODO [#C] Fix exporting so it works reliably :exporting:feature:
|
||||||
|
|
||||||
*** Description
|
*** Description
|
||||||
|
|
||||||
@ -405,8 +405,7 @@ placed in the media directory:
|
|||||||
And this should all be done in a celery task that is just kicked off by the
|
And this should all be done in a celery task that is just kicked off by the
|
||||||
"Export" button on the frontend
|
"Export" button on the frontend
|
||||||
|
|
||||||
|
** TODO [#B] Add AllTrails as a source for Trail data :trails:feature:
|
||||||
** TODO [#B] Add AllTrails as a source for Trail data :vrobbler:trails:feature:personal:project:
|
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 39313362-cdfe-46e7-bbd4-9139a65c0b3c
|
:ID: 39313362-cdfe-46e7-bbd4-9139a65c0b3c
|
||||||
:END:
|
:END:
|
||||||
@ -416,7 +415,7 @@ Pretty clear, I would love to make trails more useful. Historically I wasn't
|
|||||||
hiking a lot, which made the source for this a bit silly. But it's clear that
|
hiking a lot, which made the source for this a bit silly. But it's clear that
|
||||||
AllTrails is the best source, though having TrailForks is nice to.
|
AllTrails is the best source, though having TrailForks is nice to.
|
||||||
|
|
||||||
** TODO [#B] Add `garmin_activity_id` to the TrailLogData class :trails:feature:personal:project:
|
** TODO [#B] Add `garmin_activity_id` to the TrailLogData class :trails:feature:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 5a4fb0f8-0555-40ec-b06f-93c26bd686f4
|
:ID: 5a4fb0f8-0555-40ec-b06f-93c26bd686f4
|
||||||
:END:
|
:END:
|
||||||
@ -440,7 +439,7 @@ added.
|
|||||||
They should also probably support markdown formatting and that should be
|
They should also probably support markdown formatting and that should be
|
||||||
displayed in the template.
|
displayed in the template.
|
||||||
|
|
||||||
** TODO [#B] Add CSV endpoint for book scrobbles that LibraryThing can ingest :personal:project:books:feature:export:
|
** TODO [#B] Add CSV endpoint for book scrobbles that LibraryThing can ingest :books:feature:export:
|
||||||
https://app.todoist.com/app/task/add-a-csv-endpoint-for-users-book-reads-that-library-thing-can-ingest-6X7QPMRp265xMXqg#comment-6X7QrXq6gJjMP4hg
|
https://app.todoist.com/app/task/add-a-csv-endpoint-for-users-book-reads-that-library-thing-can-ingest-6X7QPMRp265xMXqg#comment-6X7QrXq6gJjMP4hg
|
||||||
** TODO [#B] Make IMAP and WebDAV configurable :webdav:feature:imap:importers:
|
** TODO [#B] Make IMAP and WebDAV configurable :webdav:feature:imap:importers:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -465,7 +464,6 @@ needed import celery task. This is how the WebDAV celery task currently works.
|
|||||||
This would also be an opporunity to clean up the code around WebDAV imports
|
This would also be an opporunity to clean up the code around WebDAV imports
|
||||||
and make them more re-usable for other import services.
|
and make them more re-usable for other import services.
|
||||||
|
|
||||||
|
|
||||||
** TODO [#A] Add an exception list of artists as a constant that are exempted from splitting :music:artists:metadata:
|
** TODO [#A] Add an exception list of artists as a constant that are exempted from splitting :music:artists:metadata:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: fd86a11a-73ec-470d-b5e3-2d90ba9137c8
|
:ID: fd86a11a-73ec-470d-b5e3-2d90ba9137c8
|
||||||
@ -477,7 +475,6 @@ Certain artists like "Simon & Garfunkel" are actually one artist. While we don't
|
|||||||
tracks into featured artists, we should have a "LITERAL_ARTIST_TITLES" constant that can have exceptions like
|
tracks into featured artists, we should have a "LITERAL_ARTIST_TITLES" constant that can have exceptions like
|
||||||
this put into it and then we stop trying to pull the artist apart when we run into it.
|
this put into it and then we stop trying to pull the artist apart when we run into it.
|
||||||
|
|
||||||
|
|
||||||
** TODO [#A] Before enriching anything, trust the POST data :feature:scrobbles:metadata:
|
** TODO [#A] Before enriching anything, trust the POST data :feature:scrobbles:metadata:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: db6b05f8-09f4-49f5-9838-fbacc9fe9cd0
|
:ID: db6b05f8-09f4-49f5-9838-fbacc9fe9cd0
|
||||||
@ -509,11 +506,6 @@ log a warning and move on.
|
|||||||
We should have a global view `/favorites/` that shows the logged in users's
|
We should have a global view `/favorites/` that shows the logged in users's
|
||||||
favorited media objects.
|
favorited media objects.
|
||||||
|
|
||||||
** TODO [#B] Scrape ComicBookRoundUp ratings for comic book metadata :vrobbler:books:feature:comicbook:personal:project:
|
|
||||||
|
|
||||||
- Note taken on [2025-09-25 Thu 10:51]
|
|
||||||
|
|
||||||
As an example https://comicbookroundup.com/comic-books/reviews/humanoids-publishing/the-history-of-science-fiction
|
|
||||||
** TODO [#B] Find page numbers for comic books from ComicVine :feature:books:
|
** TODO [#B] Find page numbers for comic books from ComicVine :feature:books:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 79f867c3-1288-4143-b6bf-2a452983ee9f
|
:ID: 79f867c3-1288-4143-b6bf-2a452983ee9f
|
||||||
@ -547,6 +539,34 @@ Examples of trends:
|
|||||||
- trail_scrobble__average_heartrate per trail
|
- trail_scrobble__average_heartrate per trail
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
|
** TODO [#B] Scrape ComicBookRoundUp ratings for comic book metadata :books:feature:comicbook:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: b3cc57ca-3d2c-468d-ab7c-c47f1120309b
|
||||||
|
:END:
|
||||||
|
|
||||||
|
*** Description
|
||||||
|
As an example https://comicbookroundup.com/comic-books/reviews/humanoids-publishing/the-history-of-science-fiction
|
||||||
|
|
||||||
|
** DONE [#B] Paginate or limite scrobbles on media admin pages :admin:scrobbles:media:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: f02e487b-d7ed-4834-838a-303560f2ad3b
|
||||||
|
:END:
|
||||||
|
|
||||||
|
** DONE [#B] Clean up books admin :admin:books:bug:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 7539bee6-0a52-26f6-ebc6-5554ac49a716
|
||||||
|
:END:
|
||||||
|
** DONE [#B] Clean up favorites admin :admin:favorites:scrobbles:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: f2be0c69-1bf8-b5a3-5269-9c8ea873361d
|
||||||
|
:END:
|
||||||
|
|
||||||
|
|
||||||
|
*** Description
|
||||||
|
|
||||||
|
Some FK lookups in admin should be raw_id_fields.
|
||||||
|
|
||||||
|
|
||||||
* Version 51.4 [1/1]
|
* Version 51.4 [1/1]
|
||||||
** DONE [#A] Clean up metadata comicbook enrichment :bug:comics:books:metadata:
|
** DONE [#A] Clean up metadata comicbook enrichment :bug:comics:books:metadata:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class BeerAdmin(admin.ModelAdmin):
|
|||||||
"uuid",
|
"uuid",
|
||||||
"title",
|
"title",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("styles", "producer")
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
search_fields = ("title",)
|
search_fields = ("title",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -27,4 +27,5 @@ class BirdingLocationAdmin(admin.ModelAdmin):
|
|||||||
class BirdingCSVImportAdmin(admin.ModelAdmin):
|
class BirdingCSVImportAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("uuid", "process_count", "processed_finished", "processing_started", "error_log")
|
list_display = ("uuid", "process_count", "processed_finished", "processing_started", "error_log")
|
||||||
|
raw_id_fields = ("user",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class BoardGameLocationAdmin(admin.ModelAdmin):
|
|||||||
"uuid",
|
"uuid",
|
||||||
"geo_location",
|
"geo_location",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("geo_location",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
|
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ class BoardGameAdmin(admin.ModelAdmin):
|
|||||||
"title",
|
"title",
|
||||||
"published_year",
|
"published_year",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("publisher", "publishers", "designers", "expansion_for_boardgame")
|
||||||
search_fields = ("title",)
|
search_fields = ("title",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class BookAdmin(admin.ModelAdmin):
|
|||||||
"first_publish_year",
|
"first_publish_year",
|
||||||
"pages",
|
"pages",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("authors",)
|
||||||
search_fields = ("name",)
|
search_fields = ("name",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
inlines = [
|
inlines = [
|
||||||
@ -38,7 +39,7 @@ class BookAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
|
|
||||||
@admin.register(Paper)
|
@admin.register(Paper)
|
||||||
class BookAdmin(admin.ModelAdmin):
|
class PaperAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = (
|
list_display = (
|
||||||
"title",
|
"title",
|
||||||
@ -47,6 +48,7 @@ class BookAdmin(admin.ModelAdmin):
|
|||||||
"first_publish_year",
|
"first_publish_year",
|
||||||
"pages",
|
"pages",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("authors",)
|
||||||
search_fields = ("name",)
|
search_fields = ("name",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class FoodAdmin(admin.ModelAdmin):
|
|||||||
"uuid",
|
"uuid",
|
||||||
"title",
|
"title",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("category",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
search_fields = ("title",)
|
search_fields = ("title",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -6,6 +6,7 @@ from people.models import Person, PersonScrobble
|
|||||||
class PersonAdmin(admin.ModelAdmin):
|
class PersonAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "bgg_username", "bgstats_id")
|
list_display = ("name", "bgg_username", "bgstats_id")
|
||||||
|
raw_id_fields = ("user", "created_by")
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
search_fields = ("name",)
|
search_fields = ("name",)
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class PodcastAdmin(admin.ModelAdmin):
|
|||||||
"producer",
|
"producer",
|
||||||
"active",
|
"active",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("producer",)
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ class PodcastEpisodeAdmin(admin.ModelAdmin):
|
|||||||
"title",
|
"title",
|
||||||
"podcast",
|
"podcast",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("podcast",)
|
||||||
list_filter = ("podcast",)
|
list_filter = ("podcast",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -6,6 +6,7 @@ from profiles.models import UserProfile
|
|||||||
@admin.register(UserProfile)
|
@admin.register(UserProfile)
|
||||||
class UserProfileAdmin(admin.ModelAdmin):
|
class UserProfileAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
|
raw_id_fields = ("user",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
readonly_fields = ("timezone_change_log",)
|
readonly_fields = ("timezone_change_log",)
|
||||||
exclude = (
|
exclude = (
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class PuzzleAdmin(admin.ModelAdmin):
|
|||||||
"uuid",
|
"uuid",
|
||||||
"title",
|
"title",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("manufacturer",)
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
search_fields = ("title",)
|
search_fields = ("title",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -19,35 +19,11 @@ from scrobbles.mixins import Genre
|
|||||||
class ScrobbleInline(admin.TabularInline):
|
class ScrobbleInline(admin.TabularInline):
|
||||||
model = Scrobble
|
model = Scrobble
|
||||||
extra = 0
|
extra = 0
|
||||||
raw_id_fields = (
|
per_page = 15
|
||||||
"video",
|
ordering = ("-timestamp",)
|
||||||
"channel",
|
show_change_link = True
|
||||||
"podcast_episode",
|
fields = ("timestamp", "media_type", "source", "in_progress")
|
||||||
"track",
|
readonly_fields = fields
|
||||||
"video_game",
|
|
||||||
"book",
|
|
||||||
"paper",
|
|
||||||
"sport_event",
|
|
||||||
"food",
|
|
||||||
"board_game",
|
|
||||||
"geo_location",
|
|
||||||
"task",
|
|
||||||
"puzzle",
|
|
||||||
"mood",
|
|
||||||
"brick_set",
|
|
||||||
"trail",
|
|
||||||
"beer",
|
|
||||||
"web_page",
|
|
||||||
"life_event",
|
|
||||||
"birding_location",
|
|
||||||
"user",
|
|
||||||
)
|
|
||||||
exclude = (
|
|
||||||
"scrobble_log",
|
|
||||||
"timezone",
|
|
||||||
"videogame_save_data",
|
|
||||||
"screenshot",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ImportBaseAdmin(admin.ModelAdmin):
|
class ImportBaseAdmin(admin.ModelAdmin):
|
||||||
@ -121,7 +97,9 @@ class ScrobbleAdmin(admin.ModelAdmin):
|
|||||||
"user",
|
"user",
|
||||||
)
|
)
|
||||||
raw_id_fields = (
|
raw_id_fields = (
|
||||||
|
"user",
|
||||||
"video",
|
"video",
|
||||||
|
"channel",
|
||||||
"podcast_episode",
|
"podcast_episode",
|
||||||
"track",
|
"track",
|
||||||
"sport_event",
|
"sport_event",
|
||||||
@ -152,6 +130,7 @@ class ScrobbleAdmin(admin.ModelAdmin):
|
|||||||
"user",
|
"user",
|
||||||
)
|
)
|
||||||
ordering = ("-timestamp",)
|
ordering = ("-timestamp",)
|
||||||
|
readonly_fields = ("share_token_version", "share_view_count")
|
||||||
|
|
||||||
def media_name(self, obj):
|
def media_name(self, obj):
|
||||||
return obj.media_obj
|
return obj.media_obj
|
||||||
@ -178,14 +157,19 @@ class FavoriteMediaAdmin(admin.ModelAdmin):
|
|||||||
list_filter = ("media_type", "sent_to_mopidy", "user")
|
list_filter = ("media_type", "sent_to_mopidy", "user")
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
raw_id_fields = (
|
raw_id_fields = (
|
||||||
|
"user",
|
||||||
"video",
|
"video",
|
||||||
|
"channel",
|
||||||
"track",
|
"track",
|
||||||
"podcast_episode",
|
"podcast_episode",
|
||||||
"sport_event",
|
"sport_event",
|
||||||
"book",
|
"book",
|
||||||
|
"paper",
|
||||||
"video_game",
|
"video_game",
|
||||||
"board_game",
|
"board_game",
|
||||||
"geo_location",
|
"geo_location",
|
||||||
|
"puzzle",
|
||||||
|
"food",
|
||||||
"task",
|
"task",
|
||||||
"mood",
|
"mood",
|
||||||
"brick_set",
|
"brick_set",
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class SportAdmin(admin.ModelAdmin):
|
|||||||
class LeagueAdmin(admin.ModelAdmin):
|
class LeagueAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "abbreviation_str")
|
list_display = ("name", "abbreviation_str")
|
||||||
|
raw_id_fields = ("sport",)
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ class LeagueAdmin(admin.ModelAdmin):
|
|||||||
class PlayerAdmin(admin.ModelAdmin):
|
class PlayerAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "league", "team")
|
list_display = ("name", "league", "team")
|
||||||
|
raw_id_fields = ("league", "team")
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -37,6 +39,7 @@ class PlayerAdmin(admin.ModelAdmin):
|
|||||||
class SeasonAdmin(admin.ModelAdmin):
|
class SeasonAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "league")
|
list_display = ("name", "league")
|
||||||
|
raw_id_fields = ("league",)
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +47,7 @@ class SeasonAdmin(admin.ModelAdmin):
|
|||||||
class RoundAdmin(admin.ModelAdmin):
|
class RoundAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "season")
|
list_display = ("name", "season")
|
||||||
|
raw_id_fields = ("season",)
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -51,6 +55,7 @@ class RoundAdmin(admin.ModelAdmin):
|
|||||||
class TeamAdmin(admin.ModelAdmin):
|
class TeamAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "created"
|
date_hierarchy = "created"
|
||||||
list_display = ("name", "league")
|
list_display = ("name", "league")
|
||||||
|
raw_id_fields = ("league",)
|
||||||
ordering = ("name",)
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
@ -63,6 +68,7 @@ class SportEventAdmin(admin.ModelAdmin):
|
|||||||
"event_type",
|
"event_type",
|
||||||
"comp_str",
|
"comp_str",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("league", "teams", "players", "round")
|
||||||
list_filter = ("league", "event_type")
|
list_filter = ("league", "event_type")
|
||||||
ordering = ("-created",)
|
ordering = ("-created",)
|
||||||
inlines = [
|
inlines = [
|
||||||
|
|||||||
@ -26,6 +26,7 @@ class GameAdmin(admin.ModelAdmin):
|
|||||||
"main_story_time",
|
"main_story_time",
|
||||||
"release_year",
|
"release_year",
|
||||||
)
|
)
|
||||||
|
raw_id_fields = ("platforms",)
|
||||||
search_fields = (
|
search_fields = (
|
||||||
"title",
|
"title",
|
||||||
"alternative_name",
|
"alternative_name",
|
||||||
|
|||||||
Reference in New Issue
Block a user