Add Last.fm importing
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from scrobbles.models import AudioScrobblerTSVImport, Scrobble
|
||||
from scrobbles.models import (
|
||||
AudioScrobblerTSVImport,
|
||||
ChartRecord,
|
||||
LastFmImport,
|
||||
Scrobble,
|
||||
)
|
||||
|
||||
|
||||
class ScrobbleInline(admin.TabularInline):
|
||||
@ -17,6 +21,38 @@ class AudioScrobblerTSVImportAdmin(admin.ModelAdmin):
|
||||
ordering = ("-created",)
|
||||
|
||||
|
||||
@admin.register(LastFmImport)
|
||||
class LastFmImportAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = "created"
|
||||
list_display = ("uuid", "created", "process_count", "processed_on")
|
||||
ordering = ("-created",)
|
||||
|
||||
|
||||
@admin.register(ChartRecord)
|
||||
class ChartRecordAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = "created"
|
||||
list_display = (
|
||||
"user",
|
||||
"rank",
|
||||
"year",
|
||||
"week",
|
||||
"month",
|
||||
"day",
|
||||
"media_name",
|
||||
)
|
||||
ordering = ("-created",)
|
||||
|
||||
def media_name(self, obj):
|
||||
if obj.video:
|
||||
return obj.video
|
||||
if obj.track:
|
||||
return obj.track
|
||||
if obj.podcast_episode:
|
||||
return obj.podcast_episode
|
||||
if obj.sport_event:
|
||||
return obj.sport_event
|
||||
|
||||
|
||||
@admin.register(Scrobble)
|
||||
class ScrobbleAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = "timestamp"
|
||||
|
||||
Reference in New Issue
Block a user