Skip to content

Commit

Permalink
Merge branch 'NAStool:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
HateBaozi authored Mar 29, 2023
2 parents c30d403 + e5838c3 commit 2599ba5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions app/db/media_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def empty(self, server_type=None, library=None):
if server_type and library:
self.session.query(MEDIASYNCITEMS).filter(MEDIASYNCITEMS.SERVER == server_type,
MEDIASYNCITEMS.LIBRARY == library).delete()
elif server_type:
self.session.query(MEDIASYNCITEMS).filter(MEDIASYNCITEMS.SERVER == server_type).delete()
else:
self.session.query(MEDIASYNCITEMS).delete()
self.session.commit()
Expand Down
2 changes: 1 addition & 1 deletion app/mediaserver/media_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def sync_mediaserver(self):
movie_count = 0
tv_count = 0
# 清空登记薄
self.mediadb.empty()
self.mediadb.empty(server_type=self._server_type)
for library in self.get_libraries():
if str(library.get("id")) not in librarys:
continue
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_VERSION = 'v3.1.0'
APP_VERSION = 'v3.1.1'
10 changes: 5 additions & 5 deletions web/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,27 +1553,27 @@ def slack():
msg_json = request.get_json()
if msg_json:
if msg_json.get("type") == "message":
channel = msg_json.get("user")
userid = msg_json.get("user")
text = msg_json.get("text")
username = msg_json.get("user")
elif msg_json.get("type") == "block_actions":
channel = msg_json.get("client", {}).get("id")
userid = msg_json.get("user", {}).get("id")
text = msg_json.get("actions")[0].get("value")
username = msg_json.get("user", {}).get("name")
elif msg_json.get("type") == "event_callback":
channel = msg_json.get("event", {}).get("client")
userid = msg_json.get("user", {}).get("id")
text = re.sub(r"<@[0-9A-Z]+>", "", msg_json.get("event", {}).get("text"), flags=re.IGNORECASE).strip()
username = ""
elif msg_json.get("type") == "shortcut":
channel = ""
userid = msg_json.get("user", {}).get("id")
text = msg_json.get("callback_id")
username = msg_json.get("user", {}).get("username")
else:
return "Error"
log.info(f"收到Slack消息:username={username}, text={text}")
WebAction().handle_message_job(msg=text,
in_from=SearchType.SLACK,
user_id=channel,
user_id=userid,
user_name=username)
return "Ok"

Expand Down
10 changes: 5 additions & 5 deletions web/static/components/page/mediainfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ export class PageMediainfo extends CustomElement {
<span class="h3" ?hidden=${!this.media_info.douban_link}>| 豆瓣: <a href="${this.media_info.douban_link}" target="_blank">${this.media_info.douban_id}</a>
${Object.keys(this.media_info).length === 0 ? this._render_placeholder("205px") : nothing }
</div>
<div class="align-self-center align-self-md-start mt-2">
<div class="align-self-center align-self-md-start text-center mt-1">
${Object.keys(this.media_info).length !== 0
? html`
<span class="btn btn-primary btn-pill me-1"
<span class="btn btn-primary btn-pill mt-1"
@click=${(e) => {
e.stopPropagation();
media_search(this.tmdbid + "", this.media_info.title, this.media_type);
Expand All @@ -140,20 +140,20 @@ export class PageMediainfo extends CustomElement {
</span>
${this.fav == "1"
? html`
<span class="btn btn-pill btn-pinterest me-1"
<span class="btn btn-pill btn-pinterest mt-1"
@click=${this._loveClick}>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="4" y1="7" x2="20" y2="7" /><line x1="10" y1="11" x2="10" y2="17" /><line x1="14" y1="11" x2="14" y2="17" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" /></svg>
删除订阅
</span>`
: html`
<span class="btn btn-pill btn-purple me-1"
<span class="btn btn-pill btn-purple mt-1"
@click=${this._loveClick}>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" /></svg>
添加订阅
</span>`
}
${this.item_url ? html`
<span class="btn btn-pill btn-green me-1" @click=${this._openItemUrl}>
<span class="btn btn-pill btn-green mt-1" @click=${this._openItemUrl}>
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-device-tv-old" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"></path><path d="M16 3l-4 4l-4 -4"></path><path d="M15 7v13"></path><path d="M18 15v.01"></path><path d="M18 12v.01"></path></svg>
在线观看
</span>
Expand Down

0 comments on commit 2599ba5

Please sign in to comment.