mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Added more hooks, we now call the proper method to cache audio test results, added force flag to skip memmo checks and overwrite invalid memmos (useful when switching algos).
This commit is contained in:
parent
9b4fdc8966
commit
8ce5c258d3
@ -114,6 +114,7 @@ class Session(object):
|
|||||||
self.settings = config_utils.load_config(paths.config_path(file_), paths.app_path("Conf.defaults"))
|
self.settings = config_utils.load_config(paths.config_path(file_), paths.app_path("Conf.defaults"))
|
||||||
self.init_sound()
|
self.init_sound()
|
||||||
self.deshelve()
|
self.deshelve()
|
||||||
|
self.fix_audio_tags()
|
||||||
# except:
|
# except:
|
||||||
# log.exception("The session configuration has failed.")
|
# log.exception("The session configuration has failed.")
|
||||||
# self.settings = None
|
# self.settings = None
|
||||||
@ -408,3 +409,10 @@ class Session(object):
|
|||||||
output.speak("An exception occurred while deshelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
output.speak("An exception occurred while deshelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
||||||
log.exception("Exception while deshelving" + shelfname)
|
log.exception("Exception while deshelving" + shelfname)
|
||||||
os.remove(shelfname)
|
os.remove(shelfname)
|
||||||
|
|
||||||
|
def fix_audio_tags(self,force=False):
|
||||||
|
"Repair audio tags."
|
||||||
|
for key,value in self.db.items():
|
||||||
|
if type(value) == list:
|
||||||
|
for t in value:
|
||||||
|
utils.is_audio(t,force=force)
|
@ -37,7 +37,7 @@ class streamer(TwythonStreamer):
|
|||||||
self.session.db[place].append(data)
|
self.session.db[place].append(data)
|
||||||
else:
|
else:
|
||||||
self.session.db[place].insert(0, data)
|
self.session.db[place].insert(0, data)
|
||||||
|
utils.is_audio(data)
|
||||||
def block_user(self, data):
|
def block_user(self, data):
|
||||||
id = data["target"]["id"]
|
id = data["target"]["id"]
|
||||||
if id in self.friends:
|
if id in self.friends:
|
||||||
|
@ -42,8 +42,8 @@ def find_next_reply(id, listItem):
|
|||||||
if listItem[i]["in_reply_to_status_id_str"] == str(id): return i
|
if listItem[i]["in_reply_to_status_id_str"] == str(id): return i
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def is_audio(tweet):
|
def is_audio(tweet,force=False):
|
||||||
if 'is_audio' in tweet:
|
if force == False and 'is_audio' in tweet:
|
||||||
return tweet['is_audio']
|
return tweet['is_audio']
|
||||||
if len(tweet["entities"]["hashtags"]) > 0:
|
if len(tweet["entities"]["hashtags"]) > 0:
|
||||||
for i in tweet["entities"]["hashtags"]:
|
for i in tweet["entities"]["hashtags"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user