diff --git a/api/funkwhale_api/audio/serializers.py b/api/funkwhale_api/audio/serializers.py index cffa49b28..6b9227ded 100644 --- a/api/funkwhale_api/audio/serializers.py +++ b/api/funkwhale_api/audio/serializers.py @@ -384,12 +384,9 @@ def get_channel_from_rss_url(url, raise_exception=False): library=channel.library, delete_existing=True, ) - latest_upload_date = max([upload.creation_date for upload in uploads]) - if ( - not channel.artist.modification_date - or channel.artist.modification_date < latest_upload_date - ): - common_utils.update_modification_date(channel.artist) + if uploads: + latest_track_date = max([upload.track.creation_date for upload in uploads]) + common_utils.update_modification_date(channel.artist, date=latest_track_date) return channel, uploads diff --git a/api/funkwhale_api/common/utils.py b/api/funkwhale_api/common/utils.py index 98fd21355..6c4238fc4 100644 --- a/api/funkwhale_api/common/utils.py +++ b/api/funkwhale_api/common/utils.py @@ -410,15 +410,15 @@ def get_audio_mimetype(mt): return aliases.get(mt, mt) -def update_modification_date(obj, field="modification_date"): +def update_modification_date(obj, field="modification_date", date=None): IGNORE_DELAY = 60 current_value = getattr(obj, field) - now = timezone.now() - ignore = current_value is not None and current_value < now - datetime.timedelta( + date = date or timezone.now() + ignore = current_value is not None and current_value < date - datetime.timedelta( seconds=IGNORE_DELAY ) if ignore: - setattr(obj, field, now) - obj.__class__.objects.filter(pk=obj.pk).update(**{field: now}) + setattr(obj, field, date) + obj.__class__.objects.filter(pk=obj.pk).update(**{field: date}) - return now + return date diff --git a/api/tests/audio/test_serializers.py b/api/tests/audio/test_serializers.py index f1dcd21c6..5ddef7c29 100644 --- a/api/tests/audio/test_serializers.py +++ b/api/tests/audio/test_serializers.py @@ -791,7 +791,7 @@ def test_get_channel_from_rss_url(db, r_mock, mocker): Subtitle Html content

]]>
- Wed, 11 Mar 2020 16:00:00 GMT + Wed, 11 Mar 2020 18:00:00 GMT 00:22:37 pop rock 2 @@ -806,7 +806,7 @@ def test_get_channel_from_rss_url(db, r_mock, mocker): Subtitle Html content

]]>
- Wed, 11 Mar 2020 16:00:00 GMT + Wed, 11 Mar 2020 17:00:00 GMT 00:22:37 pop rock 2 @@ -865,7 +865,9 @@ def test_get_channel_from_rss_url(db, r_mock, mocker): library=channel.library, delete_existing=True, ) - update_modification_date.assert_called_once_with(channel.artist) + update_modification_date.assert_called_once_with( + channel.artist, date=uploads[0].track.creation_date + ) def test_get_channel_from_rss_honor_mrf_inbox_before_http( diff --git a/front/src/components/RemoteSearchForm.vue b/front/src/components/RemoteSearchForm.vue new file mode 100644 index 000000000..56167216f --- /dev/null +++ b/front/src/components/RemoteSearchForm.vue @@ -0,0 +1,188 @@ + + diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index 732847ef5..a6e63f4d9 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -134,6 +134,9 @@ Favorites + + Subscriptions +
More diff --git a/front/src/components/audio/ChannelCard.vue b/front/src/components/audio/ChannelCard.vue index 8adbb9d2c..37db4805e 100644 --- a/front/src/components/audio/ChannelCard.vue +++ b/front/src/components/audio/ChannelCard.vue @@ -12,16 +12,24 @@
+ + %{ count } episode +
+
- - %{ count } episode - +
@@ -31,6 +39,8 @@ import PlayButton from '@/components/audio/PlayButton' import TagsList from "@/components/tags/List" +import {momentFormat} from '@/filters' + export default { props: { object: {type: Object}, @@ -58,6 +68,11 @@ export default { } else { return this.object.uuid } + }, + updatedTitle () { + let d = momentFormat(this.object.artist.modification_date) + let message = this.$pgettext('*/*/*', 'Updated on %{ date }') + return this.$gettextInterpolate(message, {date: d}) } } } diff --git a/front/src/components/common/InlineSearchBar.vue b/front/src/components/common/InlineSearchBar.vue index 0ba6d85a9..3a32b84c0 100644 --- a/front/src/components/common/InlineSearchBar.vue +++ b/front/src/components/common/InlineSearchBar.vue @@ -4,8 +4,8 @@ - - + + @@ -15,7 +15,8 @@ diff --git a/front/src/views/channels/SubscriptionsList.vue b/front/src/views/channels/SubscriptionsList.vue new file mode 100644 index 000000000..f3b3ff796 --- /dev/null +++ b/front/src/views/channels/SubscriptionsList.vue @@ -0,0 +1,103 @@ + + +