From 5f1604aece3b2370fa813be7e8fdae893c2db328 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 27 Jan 2020 16:52:58 -0600 Subject: [PATCH] Load more than 10 audio albums --- changelog.md | 4 +++- src/controller/buffers.py | 4 ++-- src/controller/mainController.py | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index d55c06a..2d6bc30 100644 --- a/changelog.md +++ b/changelog.md @@ -6,8 +6,9 @@ * Socializer will ask for confirmation before closing the application. * In all audio buffers, there is a new item in the context menu that allows downloading of the audio directly from the buffer. If there are multiple audios selected, socializer will ask for a folder where all audios should be placed. When downloading multiple audios, socializer will name those automatically by following the template "song title - artist". -* In all audio buffers, there are two new menu items for selecting and unselecting all items in the buffer. +* In all audio buffers, there are two new menu items for selecting and deselecting all items in the buffer. * Added displaying of articles as attachments in wall posts. When opened, Socializer will open the article in the web browser. +* Starting from Version 0.24, there will be an installer for the Alpha version of socializer, always available from our downloads page. ### bugfixes @@ -22,6 +23,7 @@ * When downloading a file (such as an audio file or document), the download process should be relatively faster due to some optimizations made in the function. * Socializer now uses just the first name of users in typing notifications. * socializer should be able to inform users about common errors when sending chat messages (such as sending messages to people in the current user's blacklist or banned from VK). Later, more errors related to posts will be added. +* The application will load up to 100 audio albums instead of the default 10. ## Changes in Version 0.23 (11.11.2019) diff --git a/src/controller/buffers.py b/src/controller/buffers.py index b0c1bd6..2dceb35 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -826,7 +826,7 @@ class audioBuffer(feedBuffer): widgetUtils.connect_event(m, widgetUtils.MENU, self.move_to_album, menuitem=m.move) widgetUtils.connect_event(m, widgetUtils.MENU, self.download, menuitem=m.download) widgetUtils.connect_event(m, widgetUtils.MENU, self.select_all, menuitem=m.select) - widgetUtils.connect_event(m, widgetUtils.MENU, self.unselect_all, menuitem=m.unselect) + widgetUtils.connect_event(m, widgetUtils.MENU, self.deselect_all, menuitem=m.deselect) # if owner_id is the current user, the audio is added to the user's audios. if p["owner_id"] == self.session.user_id: m.library.SetItemLabel(_("&Remove")) @@ -903,7 +903,7 @@ class audioBuffer(feedBuffer): for i in range(0, items): self.tab.list.list.SetItemImage(i, 1) - def unselect_all(self, *args, **kwargs): + def deselect_all(self, *args, **kwargs): items = self.tab.list.list.GetItemCount() for i in range(0, items): self.tab.list.list.SetItemImage(i, 0) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index bd80e55..17152ec 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -187,7 +187,7 @@ class Controller(object): if self.session.settings["vk"]["use_alternative_tokens"]: albums = self.session.vk.client_audio.get_albums(owner_id=user_id) else: - albums = self.session.vk.client.audio.getPlaylists(owner_id=user_id) + albums = self.session.vk.client.audio.getPlaylists(owner_id=user_id, count=100) albums = albums["items"] self.session.audio_albums = albums if create_buffers: @@ -198,7 +198,7 @@ class Controller(object): if self.session.settings["load_at_startup"]["video_albums"] == False and force_action == False: return log.debug("Create video albums...") - albums = self.session.vk.client.video.getAlbums(owner_id=user_id) + albums = self.session.vk.client.video.getAlbums(owner_id=user_id, count=100) self.session.video_albums = albums["items"] if create_buffers: for i in albums["items"]: @@ -320,6 +320,7 @@ class Controller(object): pub.subscribe(self.handle_longpoll_read_timeout, "longpoll-read-timeout") pub.subscribe(self.create_buffer, "create_buffer") pub.subscribe(self.user_typing, "user-typing") + pub.subscribe(self.edit_message, "edit-message") pub.subscribe(self.get_chat, "order-sent-message") pub.subscribe(self.create_timeline, "create-timeline") pub.subscribe(self.api_error, "api-error") @@ -562,6 +563,9 @@ class Controller(object): user1_nom = user["user1_nom"].split()[0] output.speak(_("{user1_nom} is typing...").format(user1_nom=user1_nom)) + def edit_message(self, obj): + print(vars(obj)) + def get_chat(self, obj=None): """ Searches or creates a chat buffer with the id of the user that is sending or receiving a message. @obj vk_api.longpoll.EventType: an event wich defines some data from the vk's long poll server."""