From 574cb552fab057517a8de1e91cf7cf746fa0056e Mon Sep 17 00:00:00 2001 From: XeroxDev Date: Fri, 25 Nov 2022 12:52:20 +0100 Subject: [PATCH] feat: add library action This commit adds an "add library" action which adds a track to the library resolves #50 --- YTMD-Connector-Icons.psd | Bin 169685 -> 182469 bytes icons/library-off.png | Bin 0 -> 3601 bytes icons/library-off@2x.png | Bin 0 -> 4323 bytes icons/library-on.png | Bin 0 -> 3331 bytes icons/library-on@2x.png | Bin 0 -> 3765 bytes manifest.json | 19 +++++++++++++++++ src/actions/library.action.ts | 38 ++++++++++++++++++++++++++++++++++ src/interfaces/enums.ts | 3 ++- src/ytmd.ts | 30 +++++++++++++-------------- 9 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 icons/library-off.png create mode 100644 icons/library-off@2x.png create mode 100644 icons/library-on.png create mode 100644 icons/library-on@2x.png create mode 100644 src/actions/library.action.ts diff --git a/YTMD-Connector-Icons.psd b/YTMD-Connector-Icons.psd index 5ce9bb78f6778b452356a41ab69a8bccb62d32b7..463b55b5d351d3076394d7dfdd76d2fa0f0aa7d5 100644 GIT binary patch delta 20084 zcmeHNd0Z67wyy3$R8&Nb3+`()d7^+DLL!*$Mx#d4D8vP2SOmd=u&98fU6L5wKsq<0 zp%l$-60h-%N}fKi(U-)li2^DrB0C7fDm$`Fzf(0mLxcKWf{FfdXZqJYbE zwVbZBBNjjJ=@B=IsopdCWu|D4Z^(q1lWc9gY;A2v&X_sLZibzg{S4oUBkgVN?I+th zOtzbDW9Q&#YwtL9$}y2+t?X^=>}>3(x!Tz~+RbpZpCTv~(;sAht!TD!aG35neZ~ws z8#|?)r_EHaskSx_)0NX~d}dCWshsNVI;)MtPP$&-*Jwx$NU*hf!S%ZvA?I7 z(6igL2aPW3Hcv5ilC5yCTZAUXV&h~6Y34cRC^Rq48pre+7*oigE@|IFhLe%tbkhzb^4p4hSTPQQTXeb(8PGr#$%b~`PHrZPUD^89+<>r(gxG}lcQ-c-+w#k_BTf;gZuSjZ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&H{#SPCzMHbe$lP?0yk6)aZKEvi^V>S zsr-q@aT&H(tdrQ~@QWBKCd4}0X(^MsOUwrPS@FCL7vVW4Ug_!Bk6YTWZz|TmKn&`i z;PhUF%A}S$c{b3C-C}#i1NgP#IUTl(=VzVXE10J;hK0Qj)*Yt~;Xz!BT{Y`^No;j$ z%~WtE>PT(Cg?PPgh%OF`9`Y*DYYsv&h|~wTMEspNI$*;yu}Acpogt(jjum3^S%tk~ z*UM`B&}Tz~@{Sk+o)W!k6%G_;-V8Q@$Hatl$AIDLFp1}Jf#_Y!_zhbNY{n}+3T+Z| zyvZ}#Bg>mt(bRV|h%b`c@pIxH2y|eu~1E1qnai#nR XL*|3o@tVK#00000NkvXXu0mjf`5EC5 literal 0 HcmV?d00001 diff --git a/icons/library-off@2x.png b/icons/library-off@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..4f18f220d55f6a58c4b7958f993aa7bb02dbfa0c GIT binary patch literal 4323 zcmd^B={wYq7yZnPU6yPkldPk~Zc>cw+l;JZmt977*+*y)D%tm4OqiM^6_RBtLUtir zk?e-C@AUKiJATh|&ppq*=f!z(Uflb{*ie^+iH`{Y02VY#3vsaP2b&R0x|%=3m2{-47_9kDBEZiT40ozJ_!XzOD_@`fJ6|Gdqr0ito8|T zG>^hafXQEg5|Wy*6b-owgtxAh(*@(3Xo27)s}wdhM*yFzA<+#8Du4maOPoCrL48Px z%wWqj(ZMga9t8r(U70=Ew+9hi^_l&AA)D*dGeR?8yxwX!L9eo78E1tHvhzhaQ40|L z-g5xJcQEkzR6#XmVSe_{Ja)m0y4_ZK>bdSKtRl2Ab=vq0OarhR_EE^DJ4nDO9IIU_dT!iti~k}MGxI9k`FWGf-vpI^h(Es5 z36Z;J>ghz-I&eQvE%!CKEav3ClTUCJCTXFIMnl$TZ$ad=J@(;A($#^P>u+r(xSwuV zJ*hVqHfYCv#H4Bob!N_REIpLl5Xd@VOb=lJNO4AF!&>?eU0&qKH4r#~)oL&pP>bA> ze8$I|3b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~ItKLwyAS!t(CB-os4^(s11AOLXAHT_X z5uNT{R(u^^TGsiKxF^{=FsIcTU18)IpN8gzKt+_Dmn9(1f(r*fm^^7y(W_BLP~@$t z6=yYmVeASMo6Q(69*qi+C@jO)qklMRRxJ#(M6kF3Zn-Ir4|IcWMlDqUSRN4<* zk=oNEAQmAL0p<9|Rp)vNG~6!1+}SJiSl!^p9d&oyBKjUZKEA@p-b5TC3aJ`87Lpqt zhMW&*kdo*Xo7=7YgvgSF@TnB?Z-6cf0Y=WP7b!^N{r?^^!i%!;-|(E?6+4zX{>%b1 zloI5+f(vl1Q}PCi2CCEHU0Vms?p~@2rfMctGG47#5(?AX>qt-{wp_DZYSF1J=3HYU z{D}K&hk-h;(BaMTJ3}U;7AD`e&M8&MG4Jj&t7$z+j{6l^7o{5CZ>Do|C=g#A_g6_^ zYh#%~U?GHXk04DrcpF<@d@rkR0(Xr^^VXva%-DFF4XaIHH1v7)#kDf zZBTmu^^oM$FNW(U=@DWA;qUjlW~cn``oYbKh?+p@mO$CEa(}sr?1<}|E*H$BrY@nD zq-R}`*)_X>6Ge}VavC1QJPmx0!ddlnHO0Z`az{q3^bgjFm1{+nU-G)1%C&sU8X0|k z{p9zYp0(k+>nJL$7dB(G?rMq(OCTEh!p*sSYDh#J3Ntd=p0g413Xvz`|5;Mx#Pj1f zh;mu^rccd)atqVw#kPwBi-AM=IU}P1iWAP-3V%?z$p%!|kpHUQ3_hW&X$`km { + private inLibrary: boolean = false; + + constructor(private plugin: YTMD, actionName: ActionTypes) { + super(plugin, actionName) + } + + @SDOnActionEvent('willAppear') + onContextAppear(event: WillAppearEvent): void { + console.log("Started"); + this.socket.onTick$ + .pipe(map(value => value.track.inLibrary), distinctUntilChanged(), takeUntil(this.destroy$)) + .subscribe((inLibrary) => { + this.inLibrary = inLibrary; + this.plugin.setState(inLibrary ? StateType.OFF : StateType.ON, event.context); + }); + } + + @SDOnActionEvent('keyUp') + onKeypressUp(event: KeyUpEvent): void { + if (!this.inLibrary) { + this.socket.playerAddLibrary(); + } + this.plugin.setState(this.inLibrary ? StateType.OFF : StateType.ON, event.context); + } + + @SDOnActionEvent('willDisappear') + onContextDisappear(event: WillDisappearEvent): void { + this.destroy$.next(); + } + +} \ No newline at end of file diff --git a/src/interfaces/enums.ts b/src/interfaces/enums.ts index 360e8a3..afe0d7d 100644 --- a/src/interfaces/enums.ts +++ b/src/interfaces/enums.ts @@ -9,5 +9,6 @@ export enum ActionTypes { DISLIKE_TRACK = 'fun.shiro.ytmdc.dislike', SONG_INFO = 'fun.shiro.ytmdc.song-info', SHUFFLE = 'fun.shiro.ytmdc.shuffle', - REPEAT = 'fun.shiro.ytmdc.repeat' + REPEAT = 'fun.shiro.ytmdc.repeat', + LIBRARY = 'fun.shiro.ytmdc.library' } diff --git a/src/ytmd.ts b/src/ytmd.ts index e31d246..05da43e 100644 --- a/src/ytmd.ts +++ b/src/ytmd.ts @@ -1,19 +1,16 @@ -import { - DidReceiveGlobalSettingsEvent, - SDOnActionEvent, - StreamDeckPluginHandler, -} from 'streamdeck-typescript'; -import { LikeDislikeAction } from './actions/like-dislike.action'; -import { MuteAction } from './actions/mute.action'; -import { NextPrevAction } from './actions/next-prev-action'; -import { PlayPauseAction } from './actions/play-pause.action'; -import { RepeatAction } from './actions/repeat.action'; -import { ShuffleAction } from './actions/shuffle.action'; -import { SongInfoAction } from './actions/song-info.action'; -import { VolChangeAction } from './actions/vol-change.action'; -import { YtmdSocketHelper } from './helper/ytmd-socket.helper'; -import { ActionTypes } from './interfaces/enums'; -import { GlobalSettingsInterface } from './interfaces/global-settings.interface'; +import {DidReceiveGlobalSettingsEvent, SDOnActionEvent, StreamDeckPluginHandler,} from 'streamdeck-typescript'; +import {LikeDislikeAction} from './actions/like-dislike.action'; +import {MuteAction} from './actions/mute.action'; +import {NextPrevAction} from './actions/next-prev-action'; +import {PlayPauseAction} from './actions/play-pause.action'; +import {RepeatAction} from './actions/repeat.action'; +import {ShuffleAction} from './actions/shuffle.action'; +import {SongInfoAction} from './actions/song-info.action'; +import {VolChangeAction} from './actions/vol-change.action'; +import {YtmdSocketHelper} from './helper/ytmd-socket.helper'; +import {ActionTypes} from './interfaces/enums'; +import {GlobalSettingsInterface} from './interfaces/global-settings.interface'; +import {LibraryAction} from "./actions/library.action"; export class YTMD extends StreamDeckPluginHandler { constructor() { @@ -29,6 +26,7 @@ export class YTMD extends StreamDeckPluginHandler { new SongInfoAction(this, ActionTypes.SONG_INFO); new ShuffleAction(this, ActionTypes.SHUFFLE); new RepeatAction(this, ActionTypes.REPEAT); + new LibraryAction(this, ActionTypes.LIBRARY); } @SDOnActionEvent('didReceiveGlobalSettings')