Skip to content

Commit f3a8393

Browse files
Add new v19 music fields
1 parent a3738de commit f3a8393

4 files changed

Lines changed: 57 additions & 3 deletions

File tree

addon.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.library.node.editor" name="Library Node Editor" version="2.0.3" provider-name="Unfledged, Team-Kodi">
2+
<addon id="plugin.library.node.editor" name="Library Node Editor" version="2.0.4" provider-name="Unfledged, Team-Kodi">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="script.module.unidecode" version="1.1.1"/>
@@ -41,8 +41,8 @@
4141
<icon>icon.png</icon>
4242
</assets>
4343
<news>
44-
2.0.2 / 2.0.3 (05/3/2021)
45-
- Fix wrong method import
44+
2.0.4 (07/3/2021)
45+
- Add new music library fields for v19
4646
</news>
4747
</extension>
4848
</addon>

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.0.4 (07/3/2021)
2+
- Add new music library fields for v19
3+
14
2.0.2 / 2.0.3 (05/3/2021)
25
- Fix wrong method import
36

resources/lib/rules.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,23 @@ def editValue( self, actionPath, ruleNum ):
233233
type = xbmcgui.INPUT_DATE
234234
if group == "isornot":
235235
type = xbmcgui.INPUT_ALPHANUM
236+
if group == "seconds":
237+
type = xbmcgui.INPUT_TIME
238+
# album duration is in HH:MM:SS but we can't call that input dialog from python so
239+
# find and strip any seconds that may be in an existing node. Use the HH:MM dialog
240+
# and add the seconds field back on before we write the node
241+
secPos = -1
242+
if curValue is not None:
243+
secPos = curValue.rfind(":00")
244+
if secPos == -1:
245+
secPos = len( curValue)
246+
if ((curValue is not None) and (secPos >= 4)):
247+
curValue = curValue[0:secPos]
248+
if len( curValue ) < 5:
249+
curValue = " " + curValue
236250
returnVal = xbmcgui.Dialog().input( LANGUAGE( 30307 ), curValue, type=type )
251+
if ( group == "seconds" and returnVal !="" ):
252+
returnVal += ":00"# Add the seconds if we previously removed them
237253
if returnVal != "":
238254
self.writeUpdatedRule( unquote(actionPath), ruleNum, value=returnVal )
239255
except:

resources/musicrules.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,41 @@
168168
<songs>True</songs>
169169
<operator>string</operator>
170170
</match>
171+
<match name="totaldiscs">
172+
<label>38077</label>
173+
<albums>True</albums>
174+
<operator>numeric</operator>
175+
</match>
176+
<match name="samplerate">
177+
<label>613</label>
178+
<songs>True</songs>
179+
<operator>numeric</operator>
180+
</match>
181+
<match name="bitrate">
182+
<label>623</label>
183+
<songs>True</songs>
184+
<operator>numeric</operator>
185+
</match>
186+
<match name="channels">
187+
<label>253</label>
188+
<songs>True</songs>
189+
<operator>numeric</operator>
190+
</match>
191+
<match name="bpm">
192+
<label>38080</label>
193+
<songs>True</songs>
194+
<operator>numeric</operator>
195+
</match>
196+
<match name="albumstatus">
197+
<label>38081</label>
198+
<albums>True</albums>
199+
<operator>string</operator>
200+
</match>
201+
<match name="albumduration">
202+
<label>180</label>
203+
<albums>True</albums>
204+
<operator>seconds</operator>
205+
</match>
171206
</matches>
172207
<operators>
173208
<group name="string">

0 commit comments

Comments
 (0)