Commit 0ad17b4b authored by Georg Krause's avatar Georg Krause
Browse files

Merge branch 'recently-added' into 'develop'

Add recntly added radio, part of #1390

Closes #1390

See merge request funkwhale/funkwhale!1325
parents 96fe772d a8ab4eed
......@@ -5,11 +5,12 @@ from django.db import connection
from django.db.models import Q
from rest_framework import serializers
from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import fields as federation_fields
from funkwhale_api.federation import models as federation_models
from funkwhale_api.moderation import filters as moderation_filters
from funkwhale_api.music.models import Artist, Library, Track, Upload
from funkwhale_api.tags.models import Tag
from . import filters, models
from .registries import registry
......@@ -320,3 +321,10 @@ class LibraryRadio(RelatedObjectRadio):
def get_related_object_id_repr(self, obj):
return obj.uuid
@registry.register(name="recently-added")
class RecentlyAdded(SessionRadio):
def get_queryset(self, **kwargs):
qs = super().get_queryset(**kwargs)
return qs.filter(artist__content_category="music").order_by("-creation_date")
Implemented awesome recently added radio (part of #1390)
......@@ -13,6 +13,7 @@
<radio-card v-if="isAuthenticated" :type="'actor-content'" :object-id="$store.state.auth.fullUsername"></radio-card>
<radio-card v-if="isAuthenticated && hasFavorites" :type="'favorites'"></radio-card>
<radio-card :type="'random'"></radio-card>
<radio-card :type="'recently-added'"></radio-card>
<radio-card v-if="$store.state.auth.authenticated" :type="'less-listened'"></radio-card>
</div>
</div>
......
......@@ -27,6 +27,10 @@ export default {
'less-listened': {
name: 'Less listened',
description: "Listen to tracks you usually don't. It's time to restore some balance."
},
'recently-added': {
name: 'Recently Added',
description: "Newest content on the network. Get some fresh air."
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment