[scrobbles] Fix admin filtering
This commit is contained in:
@ -102,7 +102,7 @@ class ChartRecordAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(Scrobble)
|
||||
class ScrobbleAdmin(admin.ModelAdmin):
|
||||
# date_hierarchy = "timestamp"
|
||||
date_hierarchy = "timestamp"
|
||||
list_display = (
|
||||
"timestamp",
|
||||
"media_name",
|
||||
@ -112,6 +112,7 @@ class ScrobbleAdmin(admin.ModelAdmin):
|
||||
"in_progress",
|
||||
"is_paused",
|
||||
"played_to_completion",
|
||||
"user",
|
||||
)
|
||||
raw_id_fields = (
|
||||
"video",
|
||||
@ -140,6 +141,7 @@ class ScrobbleAdmin(admin.ModelAdmin):
|
||||
"long_play_complete",
|
||||
"source",
|
||||
"timezone",
|
||||
"user",
|
||||
)
|
||||
ordering = ("-timestamp",)
|
||||
|
||||
@ -148,3 +150,7 @@ class ScrobbleAdmin(admin.ModelAdmin):
|
||||
|
||||
def playback_percent(self, obj):
|
||||
return obj.percent_played
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super().get_queryset(request).exclude(timestamp__year=None)
|
||||
return qs
|
||||
|
||||
Reference in New Issue
Block a user