From 90999fc3d60811e7b5b287c9c98c6935872c3f59 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 18 Dec 2018 13:18:21 -0600 Subject: [PATCH] Readded popular and suggested audios --- changelog.md | 2 ++ src/controller/mainController.py | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 71754ef..46f62c7 100644 --- a/changelog.md +++ b/changelog.md @@ -14,6 +14,8 @@ * Now Socializer will not send a notification every 5 minutes. * Socializer should handle connection errors when loading items in buffers and retry in 2 minutes. Also, connection errors in the chat server are handled and chat should be able to reconnect by itself. * When trying to add an audio or video to an album, if the current user does not have any album, it will display an error instead of a traceback. +* Added popular and suggested songs. This will not work when using alternative tokens. +* Updated Russian translations: thanks to Дарья Ратникова. ## Changes in version 0.16 (13.12.2018) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 1d13d89..2965c25 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -75,7 +75,6 @@ class Controller(object): self.buffers.append(feed) # Translators: Own user's wall name in the tree view. self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts")) - ### Disabled audio stuff for now. audios = buffers.empty(parent=self.window.tb, name="audios") self.buffers.append(audios) # Translators: name for the music category in the tree view. @@ -84,12 +83,13 @@ class Controller(object): audio = buffers.audioBuffer(parent=self.window.tb, name="me_audio", composefunc="render_audio", session=self.session, endpoint="get", parent_endpoint="audio") self.buffers.append(audio) self.window.insert_buffer(audio.tab, _(u"My audios"), self.window.search("audios")) -# p_audio = buffers.audioBuffer(parent=self.window.tb, name="popular_audio", composefunc="render_audio", session=self.session, endpoint="getPopular", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"]) -# self.buffers.append(p_audio) -# self.window.insert_buffer(p_audio.tab, _(u"Populars"), self.window.search("audios")) -# r_audio = buffers.audioBuffer(parent=self.window.tb, name="recommended_audio", composefunc="render_audio", session=self.session, endpoint="getRecommendations", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"]) -# self.buffers.append(r_audio) -# self.window.insert_buffer(r_audio.tab, _(u"Recommendations"), self.window.search("audios")) + if self.session.settings["vk"]["use_alternative_tokens"] == False: + p_audio = buffers.audioBuffer(parent=self.window.tb, name="popular_audio", composefunc="render_audio", session=self.session, endpoint="getPopular", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"]) + self.buffers.append(p_audio) + self.window.insert_buffer(p_audio.tab, _(u"Populars"), self.window.search("audios")) + r_audio = buffers.audioBuffer(parent=self.window.tb, name="recommended_audio", composefunc="render_audio", session=self.session, endpoint="getRecommendations", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"]) + self.buffers.append(r_audio) + self.window.insert_buffer(r_audio.tab, _(u"Recommendations"), self.window.search("audios")) albums = buffers.empty(parent=self.window.tb, name="albums") self.buffers.append(albums) self.window.insert_buffer(albums.tab, _(u"Albums"), self.window.search("audios"))