count is read from config file for audio and wall buffers

This commit is contained in:
Manuel Cortez 2016-04-04 09:10:03 -05:00
parent 9f0d3b83a0
commit b8439903f3
2 changed files with 10 additions and 6 deletions

View File

@ -45,24 +45,24 @@ class Controller(object):
posts_ = buffers.empty(parent=self.window.tb, name="posts")
self.buffers.append(posts_)
self.window.add_buffer(posts_.tab, _(u"Posts"))
home = buffers.baseBuffer(parent=self.window.tb, name="home_timeline", session=self.session, composefunc="compose_new", endpoint="newsfeed")
home = buffers.baseBuffer(parent=self.window.tb, name="home_timeline", session=self.session, composefunc="compose_new", endpoint="newsfeed", count=self.session.settings["buffers"]["count_for_wall_buffers"])
self.buffers.append(home)
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
self.repeatedUpdate.start()
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall", extended=1)
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall", extended=1, count=self.session.settings["buffers"]["count_for_wall_buffers"])
self.buffers.append(feed)
self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts"))
audios = buffers.empty(parent=self.window.tb, name="audios")
self.buffers.append(audios)
self.window.add_buffer(audios.tab, _(u"Music"))
audio = buffers.audioBuffer(parent=self.window.tb, name="me_audio", composefunc="compose_audio", session=self.session, endpoint="get", parent_endpoint="audio", full_list=True, count=1000)
audio = buffers.audioBuffer(parent=self.window.tb, name="me_audio", composefunc="compose_audio", session=self.session, endpoint="get", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"])
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="compose_audio", session=self.session, endpoint="getPopular", parent_endpoint="audio", full_list=True, count=1000)
p_audio = buffers.audioBuffer(parent=self.window.tb, name="popular_audio", composefunc="compose_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="compose_audio", session=self.session, endpoint="getRecommendations", parent_endpoint="audio", full_list=True, count=1000)
r_audio = buffers.audioBuffer(parent=self.window.tb, name="recommended_audio", composefunc="compose_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"))

View File

@ -4,3 +4,7 @@ password = string(default="")
token = string(default="")
[general]
reverse_timelines = boolean(default=False)
[buffers]
count_for_audio_buffers = integer(default=100)
count_for_wall_buffers = integer(default=100)