Add import of Audioscrobbler files
Here we add a model for holding Audioscrobbler imports and some code to process the tab-separated files we get from Rockbox.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from scrobbles.models import Scrobble
|
||||
from scrobbles.models import AudioScrobblerTSVImport, Scrobble
|
||||
|
||||
|
||||
class ScrobbleInline(admin.TabularInline):
|
||||
@ -10,6 +10,13 @@ class ScrobbleInline(admin.TabularInline):
|
||||
exclude = ('source_id', 'scrobble_log')
|
||||
|
||||
|
||||
@admin.register(AudioScrobblerTSVImport)
|
||||
class AudioScrobblerTSVImportAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = "created"
|
||||
list_display = ("id", "tsv_file", "created")
|
||||
ordering = ("-created",)
|
||||
|
||||
|
||||
@admin.register(Scrobble)
|
||||
class ScrobbleAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = "timestamp"
|
||||
|
||||
Reference in New Issue
Block a user