INTERACT FORUM

Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: zybex on June 28, 2020, 08:45:34 am

Title: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 28, 2020, 08:45:34 am
(https://raw.githubusercontent.com/zybexXL/Zelda/master/Screenshots/About.PNG)

ZELDA v1.0 released

ZELDA is an Expression Language editor for MediaCenter. It's a playground to test and tweak your expressions until you get the wanted results. ZELDA displays the result of a given expression immediately as you type, so there's no need to go back and forth to MC to test the expression. This makes the development & test process much faster.

Features:
- syntax highlighting, current function/args highlighting
- continuous code evaluation (see the results immediately)
- test expressions against any file or all files in a playlist simultaneously
- multiple expression tabs
- context sensitive function syntax/help
- multiple output modes (text/rendered/playlist column)
- HTML tag support: font, b/u/i, img with full src path or "tooltip:" for thumbnails, logos, etc
- helper for Font/Img insertion, color selector
- helper for Fields and Function insertion (select from list)

Download (https://github.com/zybexXL/Zelda/releases)  -  Screenshots (https://github.com/zybexXL/Zelda/wiki)  -  Source code (https://github.com/zybexXL/Zelda)

(note: only Zelda.exe is needed. You can download Zelda.ZIP instead to bypass Windows EXE download protection.

(https://raw.githubusercontent.com/zybexXL/Zelda/master/Screenshots/MainOutput.png)

(https://raw.githubusercontent.com/zybexXL/Zelda/master/Screenshots/MainRendered.png)

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on June 28, 2020, 11:07:08 am
Excited to try this.  For challenged (not very good) programmers like me this will help me a lot.  Thanks for all of the hard work. Will download and see how it works.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: arcspin on June 28, 2020, 11:43:02 am
WOW, Cool!

This will definitely help out a code challenged person like myself.


Great work,

//arcspin

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: JimH on June 28, 2020, 11:48:37 am
Well done.  Thank you.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: marko on June 28, 2020, 12:01:36 pm
Interesting.

Below is the image section for directories of my 'one expression to rename them all' expression that Zelda is not interpreting correctly, more often than not, returning only "Pictures\\". Granted, it's very old, last updated around 2012 I think, and should probably be checked for optimisation, but it works fine inside MC so there's nothing pushing me to do that right now :)
Code: [Select]
If(isequal([media type],image,1),
ifelse(
isequal([type],Clipart,1),\Pictures\[type]\removeleft([keywords],9)\,
isequal([type],Girls,1),\Pictures\[type]\[population]\,
!isequal([type],unknown type,1),Pictures\[type]\if(isequal([genre],unknown genre,1),,[genre]),
!isempty([Occasion,0]),Pictures\!Occasions\[Occasion]\[filenamedate],
isequal([keywords,0],day tripping,8),Pictures\!Day Tripping\[Location]\[filenamedate],
!isequal([Album,0],//,8),Pictures\!Picture Albums\[Album],
isequal([source],Scanner,8),Pictures\!Photographer\[artist]\![source]\[filenamedate],
isequal([source],Flickr,8),Pictures\if(isempty([artist,0]),!Source\[source],!Photographer\[artist]\![source])\[filenamedate],
isequal([source],Facebook,8),Pictures\if(isempty([artist,0]),!Source\[source],!Photographer\[artist]\![source])\[filenamedate],
isequal([source],Internet Downloads,1),if(isempty([artist,0]),Pictures\!Source\[source]\[filenamedate],Pictures\!Source\[source]\![artist]\[filenamedate]),
isequal([source],Mark Wilkinson,8),Pictures\!Photographer\[artist]\[camera]\[filenamedate],
!isequal([source],Mark Wilkinson,8),Pictures\!Photographer\[artist]\[filenamedate]),)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 28, 2020, 12:14:06 pm
Thanks for testing it Marko.
Note that Zelda is not evaluating the expression, it's just giving it off to MC and showing the evaluation result. It does do some massaging of the output but only for the "Rendered" tab (converting font/img/other tags to proper HTML).

Are you saying it doesn't show correctly on the Rendered tab, or that the Text output only shows "Pictures\\" ? If it's the second case, then... that's just what MC is calculating that expression to.

Can you tell me what is the expected output? I don't have pictures in my collection to test this :/
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 28, 2020, 12:27:52 pm
Ok, I can see what the expression is supposed to return.
One case where I can see it returning just "Pictures\\" is if you're testing it on a File with blank [type] and [genre]="unknown genre" - in this case, line 5 would correctly return "Pictures\\".

You can select a different file to test, or check the "playlist" tab to see the output of the expression against each file of the playlist.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: marko on June 28, 2020, 12:51:03 pm
Yeah, of course. In the rename tool, the evaluator inserts "unknown field" for blanks to avoid empty directories being created and my expression utilises this to arrive at the desired result.

I was forgetting this, just looking for a crazy complex expression to try out on Zelda.

Zelda's first impressions are pretty cool by the way. Users will find links to the wiki very useful. The wiki should hopefully be fully up to date in the next couple of weeks, time permitting.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: RoderickGI on June 28, 2020, 07:12:50 pm
Bravo!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: ferday on June 28, 2020, 07:17:38 pm
fantastic work Zybex.  thanks for the efforts!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: ssands on June 29, 2020, 02:45:59 pm
Wow! Thanks so much for doing this!
Excited to try it out.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 29, 2020, 03:37:37 pm
Thanks guys, glad you like it.
Please provide some feedback/reports after using it :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: MagerClab on June 29, 2020, 04:43:09 pm
Very good. Thank you! :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Moe on June 29, 2020, 05:45:18 pm
I've been stuck on "Connecting to JRiver... - Reading Playlists" for about five minutes now.


EDIT: Let it run for 25 minutes.  Never go past the msg above. 
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2020, 02:30:42 am
Hi Moe,
That should take just a few seconds max. It's almost the exact same code as in ZRatings, which I think you use. Does the progress bar stop scrolling or never stops?
Try starting MC before Zelda. Ler me know if it still doesn't work, I'll get you a debug version with more logging.

EDIT:
I remembered you also had the same problem with ZRatings and I added a "fast start" option because of that. I now did the same change on Zelda and sent you a debug build via PM. Let me know if that fixes it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Moe on June 30, 2020, 03:25:21 pm
Logging found the culprit.  It was the built in playlist "Audio -- Task -- Missing files" that was causing the problems.  I deleted that playlist and it booted right up.  Thanks for the quick update.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2020, 03:58:15 pm
Great :)
Then I'll keep the normal startup sequence that gets the file count for each playlist, and just skip that playlist if it exists.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Hendrik on June 30, 2020, 04:43:20 pm
Users could have other pretty slow playlists. I deleted all the built-in ones in my library and then at some point re-made a missing file playlist.
If you can look at the expression that make up a smartlist, you could skip those with IsMissing() in them or such, thats the only expression thats truely going to be incredibly slow over a large library - that I currently remember, anyway.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2020, 05:06:07 pm
The COM API doesn't give me the field expression, just the name. I'll have to switch to MWCS at some point, but there are some missing stuff there compared to the COM API, so that would need to be checked first.

But actually, I think IsMissing() should be fixed, it's almost unusable as it is. Other network access internals in MC also sometimes cause it to hang for 30 seconds when clicking on something, just because the NAS happens to be offline.

Possible improvements:
- MC could cache network access results - 1 or 2 timeouts could add the hostname to a blacklist for some time - a background thread could then periodically re-rest the blacklist elements to clean it up when they come back online
- IsMissing() could timeout in 500ms instead of waiting for the Windows call to return
- Playlists with IsMissing() could return a cached set instead of trying to re-check the availability on each access

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Hendrik on June 30, 2020, 05:20:58 pm
IsMissing() is not only slow when a drive is down, it needs to hit the file system for every single file if it exists. That is just a slow operation for thousands of files.

I would generally suggest to avoid blindly loading every single smartlist without a user request.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2020, 05:49:33 pm
I'm simply asking how many files each playlist has to display on the list drop-down. It's nice to have, but not critical. However, asking this for a given playlist should not lead to a 30 minute API freeze.

These playlists for missing files, by definition, only contain files that are inaccessible. For local c: files that is not a problem, it takes 1 second to do 1000 file checks on an SSD. But for a missing LAN share, windows times out after 20 or 30 seconds for EACH call. That is why Moe sees it freezing for 30 minutes.

You can do a simple test on MC. Add a network file, disconnect the file server, and then just click on the file... MC UI freezes for some time. That is not nice.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2020, 05:59:55 pm
Many threads about the issue:
https://yabb.jriver.com/interact/index.php/topic,122262.msg846083.html#msg846083

I'm under the impression that this was actually fixed recently and the UI is no longer freezing, but I'm not sure (on my mobile now, can't test). But it'll still a problem on the API.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: jherbert on July 02, 2020, 12:46:06 pm
I am also stuck at "reading playlists".
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 02, 2020, 01:44:31 pm
Hi JHerbert,
Please get v1.0.1 v1.0.2 which adds a timeout on reading playlists:
https://github.com/zybexXL/Zelda/releases/tag/1.0.2

It will try to read each playlist and automatically skip the bad/slow ones. You can check the logfile to see which playlists were skipped - log is at %temp%\zelda folder. Each bad playlist adds just 1 second to the total startup time.

v1.0.2: I added an indicator on the playlist dropdown showing when the playlist timed out - check screenshot below.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 02, 2020, 02:04:08 pm
For existing users - note that Zelda has auto-update function. You'll get a red status message saying there's a new version available, just click it to upgrade.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: jherbert on July 07, 2020, 02:46:47 am
Forgot to mention that I receive the following error upon startup (long version):

When I click continue the app starts just fine.

---------------------------------------------------


Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Zelda.ZeldaUI.resizeGridColumns()
   bei Zelda.ZeldaUI.LoadState()
   bei Zelda.ZeldaUI.ZeldaUI_Load(Object sender, EventArgs e)
   bei System.Windows.Forms.Form.OnLoad(EventArgs e)
   bei System.Windows.Forms.Form.OnCreateControl()
   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   bei System.Windows.Forms.Control.CreateControl()
   bei System.Windows.Forms.Control.WmShowWindow(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.Form.WmShowWindow(Message& m)
   bei System.Windows.Forms.Form.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll.
----------------------------------------
_Zelda
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Joachim%20Herbert/Desktop/Zelda%201.0.2.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Data
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll.
----------------------------------------
System.Core
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.
----------------------------------------
System.Configuration
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
System.Xml
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
System.Runtime.Serialization
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll.
----------------------------------------
SMDiagnostics
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll.
----------------------------------------
System.ServiceModel.Internals
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4180.0 built by: NET48REL1LAST_B.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll.
----------------------------------------
System.RunTime.Serialization.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4084.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Runtime.Serialization.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.


Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 07, 2020, 05:33:32 am
Thanks for reporting JHerbert, fixed in v1.0.4.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on July 08, 2020, 01:20:24 pm
Awesome work. The only way it could be any better is if it were somehow directly built into MC. I haven't done any real work with it yet but as I was poking around everytime I thought "This is pretty nice, but I wish it did <this other thing>" followed shortly by "Oh! It DOES do <this other thing>!" Very well done.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on July 08, 2020, 01:29:18 pm
And just as I finish saying that I do find something that I, at least, would find useful.

Since I was previously using either VS Code or Notepad++ with the syntax highlighter to edit my expressions, I began saving them all as text files in a git repo. I used the ".jexp" extension to give Notepad++ something to key off of to know which syntax to use. I found it useful for times when I accidentally broke something and needed to revert an old commit, and it was easier than constant copy/pasting back and forth. If I needed to edit an expression I would just open it from the repo, make my edit, then do one copy/paste into MC. I might have to do that a few times if the expression wasn't correct. So anyway, would it be possible that Zelda could allow for saving/opening expressions that are saved as text files? Or open an entire directory and allow browsing for them in a tree, like you can with editors like VS Code, Sublime, etc? And then maybe a copy button to allow easy copy/paste into MC? If it did that I could easily browse for the expression I need, edit it, see the results immediately, all from within Zelda, and then only do a final copy/paste once I'm done.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 08, 2020, 01:47:50 pm
Hi Doof, thanks for the feedback :)

Those are good ideas - I initially had a couple of buttons for file load/save, but then I decided to just save the session state (list of tabs and their content) and thought that load/saving was redundant. But you have a point with GIT, it still makes sense to have it. I'll add this to the TODO, along with an optional file extension association (.jexp, you named it).

Button to copy the tab content - you just need to do CTRL-A/CTRL-C, but a toolbar button is easy to add. What I'd like to do, however, is load an expression from a given field (like "tooltip") into a tab, edit it, and then save it back to the field directly. Unfortunately the API doesn't allow me to do that yet, but Matt said he'll add the missing functionality eventually.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on July 08, 2020, 02:07:12 pm
If they do add the ability to load/save expressions directly from MC, that would be awesome and would definitely remove the necessary copy/paste. The only downside would be losing the versioning, but given how easy Zelda makes it to edit your expressions and confirm they work as expected, versioning may not be as important as it was before. I also didn't realize Zelda would save state like that, so that's cool. Between that and the hoped-for future ability to save directly, the git repo probably wouldn't be necessary anymore, although I was thinking it might be a useful way to share expressions with the community.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 08, 2020, 02:46:39 pm
MC has 2 APIs:
- COM API: this has the GetFilledTemplate() function to evaluate an expression, but cannot read/write field expressions, just their already-calculated content.
- MCWS: this has functions to read/write the field expressions, but is missing the evaluate functionality.

I'm using the COM API, which has apparently been declared a dead end. Matt said he'll add the "evaluate" API to MCWS... after that's available I can switch Zelda to it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on July 08, 2020, 03:27:17 pm
I'm using the COM API, which has apparently been declared a dead end.

Been a while since I did any MC plugin dev or kept up with the current state of things. What does this mean for third party plugins? Can they use MWCS? Is the COM API going away or is it just in an "as-is" state from here on? I briefly toyed with the idea of dusting off my old LyricsEditor/Captionator plugins to get them working properly again, so I'm curious if it would be a lost cause.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 08, 2020, 03:52:21 pm
I believe it's just frozen, but will remain available. The MCWS Rest API is just more flexible and easier to expand. I suppose in-app plugins can also use it, but I don't know.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: marko on August 01, 2020, 12:04:47 pm
You know how there are some places in MC that will only accept an expression in a single line?

But, (bad grammar, I know) when constructing, it's often easier to write them with carriage returns and tabs...

Could Zelda have a button that would make a long and complex, multi-line expression a single line in one click, maybe, putting that into a new tab so as to preserve the multi-line work?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on August 01, 2020, 11:56:38 pm
Could Zelda have a button that would make a long and complex, multi-line expression a single line in one click, maybe, putting that into a new tab so as to preserve the multi-line work?

Could even just copy that version of the expression to the clipboard without opening the extra tab if the only use for it is to paste back into MC.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on August 02, 2020, 01:39:32 am
Sure. I'll add that after coming back from vacation, in 10 days or so.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: marko on August 02, 2020, 01:50:26 am
Thank you, enjoy your vacation, as much as you can in these scary times.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on August 12, 2020, 03:59:38 pm
ZELDA v1.0.6 published:
- Add context menu option "Copy as Single Line - Strip CRLF" (CTRL+SHIFT+C)
- Add context menu option "Copy as Single Line - Preserve CRLF" (CTRL+ALT+C)

Right-click on the expression to get the context menu. Both options copy the entire expression to Clipboard as a single line of text.

The first option just concatenates all lines into a single line by removing the newline chars (CR/LF).

The second option replaces CR/LF chars with "char(10)" which causes a newline to be printed when the expression is executed. This allows you to build expressions which output multiple lines of text, but can still be concatenated into a single-line expression. This option also takes into consideration the whitespace rules of the Expression Language (newlines after commas are ignored by the language).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 07, 2020, 04:26:19 am
ZELDA v1.0.7 published:
- Update function Wiki with new functions and Wiki links
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on September 11, 2020, 11:18:37 am
I'm just starting to work on this and having some minor challenges.  My text rendered output does not match up with my actual output.  Rendered is a very dark background and actual is  a light back ground.  See attached files

Any thoughts on how to get to a light background?  All the other font colors are correct.

Thanks

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 11, 2020, 12:57:53 pm
Code: [Select]
If(IsEqual([Media Type],Audio,1),
If(!IsEmpty([AMG Track Pick]),<img src="tooltip:web-amg-track-pick-top" width="50" valign="bottom">,)
,)
Throws unhandled exception for me. Seems that colon causes the havoc...
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 11, 2020, 04:08:23 pm
Any thoughts on how to get to a light background?  All the other font colors are correct.

The background color is fixed (to match my current Theme, sorry). There are options in Settings to change the colors, but they're disabled for now.
I'll enable changing background color this weekend.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 11, 2020, 04:15:13 pm
Throws unhandled exception for me. Seems that colon causes the havoc...

Lepa, the exception is because Zelda is failing to get MC's install folder due to missing registry keys (so it can't translate the "tooltip:" to a path).
I've also had some problems after upgrading to 27 - reinstalling the latest 27 fixed those issues.

Before you do that, can you please let me know:
- which MC version you have, and is it 32 or 64bit
- is there a key called "Install Directory" under this Registry key: (I assume this is missing for you)
HKEY_CURRENT_USER\Software\JRiver\Media Center 27\Installer

Thanks!

@MC team: after upgrading to 27 and uninstalling 26 the "HKCR\MediaJukebox Application" key was missing for me, even though I selected the option to preserve registry settings during uninstall. It looks like the App is unregistered anyway.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 11, 2020, 04:48:10 pm
Lepa, the exception is because Zelda is failing to get MC's install folder due to missing registry keys (so it can't translate the "tooltip:" to a path).
I've also had some problems after upgrading to 27 - reinstalling the latest 27 fixed those issues.

Before you do that, can you please let me know:
- which MC version you have, and is it 32 or 64bit
- is there a key called "Install Directory" under this Registry key: (I assume this is missing for you)
HKEY_CURRENT_USER\Software\JRiver\Media Center 27\Installer

Thanks!

@MC team: after upgrading to 27 and uninstalling 26 the "HKCR\MediaJukebox Application" key was missing for me, even though I selected the option to preserve registry settings during uninstall. It looks like the App is unregistered anyway.
27.0.12 64bit and I have the key "Install Directory" under the
Code: [Select]
Computer\HKEY_CURRENT_USER\SOFTWARE\JRiver\Media Center 27\InstallerI still have MC26 installed (not running). Zelda is connected to MC27
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on September 11, 2020, 05:09:12 pm
The background color is fixed (to match my current Theme, sorry). There are options in Settings to change the colors, but they're disabled for now.
I'll enable changing background color this weekend.

Thank you much.  Have a great weekend.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 11, 2020, 07:51:15 pm
Computer\HKEY_CURRENT_USER\SOFTWARE\JRiver\Media Center 27\Installer

Interesting - the forum seems to convert "J.  River" (with 1 space) to "JRiver" :)
I had to enter 2 spaces now to prevent it from happening.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 11, 2020, 08:16:09 pm
ZELDA v1.1 published (https://github.com/zybexXL/Zelda/releases/tag/v1.1) - just click the "new version available" notice to auto-upgrade.

- Color/font customization of editor and output panels
- Improve detection of MC27 install folder
- Update function wiki
- fix exception when MC folder detection fails
- other bug fixes

Lepa, please let me know if you still see the same issue.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 02:43:08 am
MS Defender removes new ZELDA as a trojan
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 03:35:26 am
Crap. I tried it on a couple of PCs with Defender and I don't get any alert. Chrome warns when downloading it that "it's not commonly downloaded and may be dangerous", but if you choose "Keep the file" it works, and Defender doesn't complain for me.

Here's the VirusTotal scan of the file - Microsoft says it's OK, only gets flagged by some obscure anti-malware:
https://www.virustotal.com/gui/file/ce330bd52c2a9d4f0c9afde93a6705f70dd457253d540d834bd68804ddf5dc3a/detection

Not sure what I can do here. I don't want to tell you to whitelist it, you're not supposed to trust strangers. However, the source code is published, can be reviewed, and you can compile from source if you're so inclined.

<rant>Heuristics sucks. This is an app that doesn't write anything to the Registry, doesn't drop any other files anywhere on the system except for itself and a JSON file in the %appdata% folder. Doesn't hook any system handlers. But sure, it's suspicious... then you have some malware out there that starts encrypting each and every file on your system (ransomware), and it gets to do so without the AV stopping it after a few files. sigh.</rant>

edit: Here's (https://github.com/zybexXL/Zelda/commit/9d246e381adc5e723355ef5d0ed9588ca14fd142) the code changes since last version. Must have been the latin Lorem Ipsum (https://github.com/zybexXL/Zelda/commit/9d246e381adc5e723355ef5d0ed9588ca14fd142#diff-4e0a11a53b217dca7e65e4e6d84884f4R124) ::)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 03:58:49 am
I have always found Latin a little suspicious  ;D I need to "install" it manually
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 04:09:20 am
Can confirm virustotal results for zelda.exe inside zip. Also there wasn't anything suspicious in the latest changes

Version 1.1 handles the exception but I don't get any images when using "tooltip:" notation
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 05:48:02 am
Thanks Lepa.

I published v1.1.2 (https://github.com/zybexXL/Zelda/releases/tag/v1.1.2) with the following changes [VirusTotal scan (https://www.virustotal.com/gui/file/893f37d2d7e312c387aff7285a39fcf24e38c32a19c2d606a0ddf0e63ca226f6/detection), source code changes (https://github.com/zybexXL/Zelda/commit/49cfbb8e83871ff5ff347d39a3bb2c26af9190ac)]:
- Add settings option to set Tooltip: folder
- Add logging of MC folder detection errors
- Add initial support for "valign" tag in Images [Thanks Lepa, I didn't know MC had this tag!]

So now you can go to settings and set your Tooltip folder (it also shows the detected folder, if any).
There's also extra logging - can you please check Zelda's logfile (in "%temp%\zelda" folder) and let me know which Tooltip folder it detects (if any), and any Exceptions that show up? Thanks!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 05:59:58 am
Regarding the img valign support: the look in the Rendered tab doesn't currently align images in the same way as MC. I'm using the default behavior of HTML valign, whereas MC is doing something strange - the text is always aligned to the middle, which is not standard. I don't know if it's a bug in MC or just the behavior they've chosen.

For instance:
text [image with valign=bottom] more text
=> In HTML the image bottom is aligned with the bottom of the text (text+image on the floor). In MC, the text is centered vertically to the image.

text [image with valign=top] more text
=> in HTML the text and image are now aligned on top. In MC, there's no difference - text is again in the middle.

It seems MC only considers these alignments when there are multiple images on one line - then the top/bottom alingments work as expected *for the images*. However, text is always middle-aligned in respect to the images. If feels like a bug.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: JimH on September 12, 2020, 07:04:27 am
<rant>Heuristics sucks. This is an app that doesn't write anything to the Registry, doesn't drop any other files anywhere on the system except for itself and a JSON file in the %appdata% folder. Doesn't hook any system handlers. But sure, it's suspicious... then you have some malware out there that starts encrypting each and every file on your system (ransomware), and it gets to do so without the AV stopping it after a few files. sigh.</rant>

+1
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 10:16:04 am
Thanks for the update. No MS Defender intervention this time and also images now loaded when using manual folder configuration
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 10:22:53 am
Great! I'd still like to know why it's not detecting the MC folder on your PC :/ If you can check the log file I'd appreciate it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 01:43:00 pm
Great! I'd still like to know why it's not detecting the MC folder on your PC :/ If you can check the log file I'd appreciate it.
Where do I find the log file?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 02:37:05 pm
It's in your temp folder, you can there get by pressing WIN+R and then type "%TEMP%\Zelda". You can also type it in the Explorer address bar directly (not internet explorer).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 12, 2020, 03:18:51 pm
Lepa, nevermind, Xpto has managed to reproduce it. The fix is simple - looks like I've been shipping 32bit builds instead of x64 builds, and that's causing some problems accessing 64-bit MC. i didn't see it because my debug builds are all x64.

This comes down to a stupid default in Visual Studio, which compiles to 32bit even when we say we want a 64bit binary  ::)
One line fix (https://github.com/zybexXL/Zelda/commit/6f159d14191bae692fe053ca33bbf283209e564c#diff-16528702dce1eca79937218148028126R39) in next release:
    <Prefer32Bit>false</Prefer32Bit>

Published v1.1.4 (https://github.com/zybexXL/Zelda/releases/tag/v1.1.4), should autodetect tooltip folder correctly now (fingers crossed)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 03:28:43 pm
Yes, I saw that those exceptions in log. Let's try the new one then  :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: RoderickGI on September 12, 2020, 05:38:56 pm
A note for other users.

Windows Defender is never off. I run Norton Antivirus and Firewall. When I downloaded Zelda.exe version 1.1.14 Chrome tried to stop it. I selected "Keep", then ran it. Windows Defender, which is supposed to be off when Norton is running, intervened. See the first image.

Microsoft Defender Smartscreen (note name change  ::) ) even hides how to continue under the "More Info" link, because we can't be trusted to know what we are doing. Okay, that is probably correct for many people.  ;)
See the second image.

The Norton Firewall kicked in when I ran Zelda anyway, but at least it was going to allow it. I do note however that Zelda seems to call back to GitHub on startup. Is that intended?
See the third image.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on September 12, 2020, 05:56:06 pm
It's checking github for a new version at startup
https://github.com/zybexXL/Zelda/blob/master/Zelda/Upgrade/AutoUpgrade.cs
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: RoderickGI on September 12, 2020, 05:58:31 pm
 8)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 13, 2020, 04:09:47 am
Thanks Roderick, Lepa.
Yes, Zelda connects to Github to check latest version.

(sorry for the long slightly-offtopic post, but I think this needs clearing up as there are misconceptions floating around)

Note that Defender SmartScreen is not an antivirus, it's just another security module in the Defender family. It can also be disabled in Defender settings, under "App & Browser control" (in fact, ALL defender modules can be permanently disabled one way or another, but only do so if you know what you're doing). Norton also has a module that does the exact same thing as SmartScreen so there's no need to have both active (Norton Lifelock? WTF... perfect name for the pandemic!). Note that Norton also has multiple modules than can be independently disabled - it's not called Norton AV, it's Norton Security.

Here's a rundown of the differences between modules:

Smartscreen: when a new/downloaded app is starting for the first time, Smartscreen sends the app name, hash and digital signatures to Microsoft to check if this is a known file. So any new executable file can trigger it unless it's from a well known publisher. Smartscreen also does the same for every webpage you visit (with IE/Edge), making your browsing a bit slower - Chrome does the same for URLs and downloads. As an added bonus they get to keep an entire history of everything you execute and every site you visit. I wonder why I turn it off...

Antivirus: This is purely local. It searches the file to check if it contains any signature (byte-sequence) of known malware, using a signature database which contains millions of signatures and is updated frequently. While Smartscreen only checks the initial EXE (and only by filename/hash), this one checks the entire contents of the EXE, and also checks all files that the EXE opens while it's running (hence the general system slowdown). This is where it can easily trigger problems for MC and other apps, because Video and Audio data are so large and random that they can easily contain one of the byte sequences recognized as known malware (some are very short), and then the file access is blocked. If the app is not expecting the access to be blocked, it can crash when this happens.
Antivirus goes yet a bit further to try to detect new/unknown threats: it tries to detect unusual activity from new EXEs (like network/web access, system folder/file accesses, registry writes, keyboard capture, etc), and if it considers the activity suspicious it will upload the EXE to their servers so that it can be analyzed. This behavioral, non-signature-based analysis is what is called "Heuristics". While this is a good method to find new threats, I find it extremely lacking and finicky - it often fails to flag known malware like ransomware, while at the same time uploading innocuous files over and over just because they lack a digital signature or contain the sequence "BTC" inside. YMMV with different antivirus. All of them can be disabled, including Defender, but it's good to have one. Some allow disabling heuristics, at least in the old days.

Firewall: This is just a control of all network connections made to/from an app, blocking unexpected connection requests or asking for authorization when needed (and configured to do so). Never disable it for internet access, of course. It's also useful to find out what a given app is up to, as you've highlighted above. A badly configured firewall also analyzes connections within the PC itself (applications/modules talking to each other via "localhost"); this should not be blocked and can easily cause applications to stop working, so usually the firewalls are automatically configured to ignore localhost<>localhost traffic.


I find Defender AV to be one of the most balanced out there in terms of speed, unobtrusiveness and having good detection capabilities. Norton and Karspersky have become a slow bloated mess (as McAfee did). In the old days I used ESET and Trend a lot (more enterprisey products), but as an individual user I find Defender more than adequate - but you do need to exclude many filetypes from scanning if you want a fast PC; I usually exclude all media types (*.mp3, flac, avi, mkv, mp4, etc), compressed archives (7z, zip, rar), and a few more. I've had zero problems with MC, I don't even exclude it from scan. Defender Firewall is also good and enough, so nowadays I don't install any other security product.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 23, 2020, 03:52:45 pm
Hey zybex: I'd love to use your cool application, but I can't really effectively use it. When you start up, it loads ALL Playlists in MC. Since some of my Smartlists are either (1) extremely large (I have an All Files list, for example, and other big lists for utility purposes), (2) fairly slow (because of multiple nested searches, utility lists that check for missing files, and things like that), and (3) I have a ton of them, it takes seriously 10-15 minutes just to start Zelda up on my system.

Could we get a command line option that limits the scan to a provided Playlist Group and children, instead of always searching the entire Playlist Tree?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 23, 2020, 04:36:29 pm
Sure Glynor. I though I had already added a FastStart option, but apparently not...

Can you please try this version and let me know if it starts faster for you?
https://filebin.net/q9gz97hbdg8186no

If not, please do this:
- open folder %localappdata%\Zelda in explorer
- open Zelda.json in Notepad or Notepad++
- add this line anywhere before the closing bracket - change the filter to whatever you want:
  "PlaylistFilter": "Smartlists\\Samples",
Take care not to break the JSON format - previous line must end in a comma, and backslashes need escaping \\

Then run that Zelda version. Let me know what works and I'll include it in next release.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on November 23, 2020, 05:14:42 pm
Glynor's comment illustrates how important it is to think outside the box when considering use cases in relation to performance variations regarding MC: something like what he described has never, and probably will never happen to me.  And all because I'm not much of a playlist user. I have just a few, and they're not very big.  Startup is virtually instantaneous for me. Without his comment, I wouldn't have thought playlists would be a big difference.

On the other hand I marvel as to why it will sometimes take MC 30s to close after I hit the X!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on November 24, 2020, 07:39:23 am
Can you please try this version and let me know if it starts faster for you?
https://filebin.net/q9gz97hbdg8186no
Very much so, thanks zybex
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 24, 2020, 09:19:15 am
Published Zelda v1.2: [source code changes (https://github.com/zybexXL/Zelda/commit/f3895386bfb27b5b8d104a52478d3f73d670ed49)]:
- Add FastStart setting (skips playlist counts)
- Add Playlist enumeration timeout (10 seconds)
- Add Playlist Filter

To upgrade, you can just start Zelda and click on the "new version available" label on the status bar. Alternatively, get it here (https://github.com/zybexXL/Zelda/releases/tag/v1.2).

The Fast Start option should be enough to fix the startup delay when having slow/many playlists. Even with that option off, I now added a 10 second timeout - if startup is taking more than that, it will automatically skip counting files (basically auto-enabling fast-start). So when you run this version for the first time it should take no more than 10-15 seconds, then you can go to Settings and enable the FastStart if you wish.

The Playlist Filter allows you to load only a subset of the playlists. If will only load playlists containing the specified text in their path\name. You can enter multiple values separated by semicolon, as the screenshot shows. Thanks to Glynor for the suggestion!  :)

(https://raw.githubusercontent.com/zybexXL/Zelda/master/Screenshots/Settings1.png)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 26, 2020, 11:10:04 am
Sorry. I didn't get to try your test build, though it appears that you've incorporated the changes in the new regular build. From the change-log, that'll solve it completely for me.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 27, 2020, 01:17:03 pm
This does work. However, I discovered an issue. If I set a Playlist Filter, and then later move/rename that playlist group, then Zelda refuses to load and I had to reset the JSON. So, you may want to check for that error condition and auto-reset to "normal" in a future build.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 27, 2020, 04:50:32 pm
Thanks Glynor, that needs fixing... I can either reset the filter when there are no matching playlists (load all lists), or perhaps I can make it load a well known list like "recently played". This would allow Zelda to load and the user can then go and fix Settings. What do you think?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 27, 2020, 06:42:34 pm
I'd go back to the default first-run behavior, which with my giant and slow lists worked just fine (with the 10-second timeout and switch to Fast Mode).

All I did when I inadvertently "tested" this was to delete the JSON files for it entirely, and then I was able to recover fine.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 27, 2020, 06:47:24 pm
I should note: Or, change the overall behavior to load/cache the lists individually on demand, and then you could strip the whole thing out. But, of course, that is a much bigger thing.

I think you've got it now, just kill that option if it is invalid instead of dying.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 28, 2020, 07:12:37 am
That's not really possible. Zelda does 2 things:
A. get the NAMES of all playlists available - this is fast
B. get the FILE COUNT (not the file list) in each playlist to display on the dropdown - this can get very slow, especially with many/complex Smartlists, and even worse if they have calls to IsMissing(). The delay is purely on MC side, since it recalculates each playlist content.

The "Quick Start" option skips B, but I can't really skip A unless you want to type the name of the playlist each time you want to load it.
The "Filter" option still needs to do A in order to get the names and ignore the ones that don't match the filter. So it doesn't really speed up anything. The 10 second timeout also only applies to B, since Zelda still needs to get all Playlist names. The actual playlist content (file list) is only loaded when you select one of the lists from the dropdown (at startup it auto-loads the same as last time).

I think A is very fast, but I'm not sure because I don't have many playlists. Can you tell me how long it takes for Zelda to start on your PC with the Fast Start enabled and a small playlist selected?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: glynor on November 28, 2020, 10:51:35 am
Ahh. Yes, A is fast enough. B is what is slow (getting the count of a playlist is the same as getting the contents). I'd assumed you were getting the file listing and caching it at startup, mostly based on the slowness. And I meant just pull the listing of files when the list is selected in the combobox. That's how all of my list-based applications work.

But you're actually already doing that, you're just also pulling Playlist.Count() at application launch. It is worth noting that for many of my lists then, the count displayed is often wrong anyway, because when I then select the list it'll be recalculated which may result in a different count (depending on the list in question).

Hopefully you don't use that initial count for anything other than display (or it might get horribly confused when the count doesn't match what it found initially).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 28, 2020, 11:43:45 am
Yep, the count is just for display on the playlist dropdown, and to hide playlists with zero files.
When a list is selected it gets the actual list of files from MC.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 28, 2020, 11:51:05 am
Published Zelda v1.2.1: [source code changes (https://github.com/zybexXL/Zelda/commit/b0f5ee6a9a9a798660617f594555987fa2c23d18)]:
- Don't exit when PlaylistFilter excludes all playlists (show warning)
- Reload playlists after changing Filter
- Show full playlist paths

To upgrade, you can just start Zelda and click on the "new version available" label on the status bar. Alternatively, get it here (https://github.com/zybexXL/Zelda/releases/tag/v1.2.1).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: timwtheov on December 02, 2020, 03:41:25 pm
Hey Zybex,

Love Zelda and was using version 1.2.1 last night in trying to learn how to do pretty tooltips and a better Theater View, but after a Windows update last night (including .Net Framework), I'm getting a "Microsoft .Net Framework" error when trying to open the program. And if I hit "Continue," no playlist will load when I'm in the program. Not sure what's going on, but I attached the "Details" on a txt doc.

I should also note I tried uninstalling and reinstalling MC, but that didn't help (and because I stupidly forgot to do a library backup, lost all my tooltip/Theater View work--not my day today).

Edit: Sorry, should have included a pic of error.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on December 03, 2020, 03:08:14 am
Hi timwtheov, thanks for reporting this issue.
It was not Windows Update, the crash is caused by having the "Show All Expressions" option enabled at startup - see screenshot.

The issue is now fixed in v1.2.2. To upgrade, please do one of these:
Method 1:
- just replace Zelda.exe with the one from latest release: https://github.com/zybexXL/Zelda/releases/tag/v1.2.2

Method 2:
- open folder %localappdata%\Zelda
- open ZeldaState.json in notepad
- change the line " "TableShowAll": true,"  to " "TableShowAll": false,"
- restart Zelda, use the auto-upgrade to upgrade to v1.2.2
- now you can reenable that option on Zelda


Tip of the day: Press SHIFT+WIN+S to do a screen capture with Windows Snip&Sketch. You can draw a rectangle around the area to capture, and then add highlight, crop, etc.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: timwtheov on December 03, 2020, 07:39:08 am
Just updated: thanks!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on December 14, 2020, 03:59:00 pm
Just a quick heads up that I believe that there is small error in Zelda v1.2.2

if I insert a image as follows :  <img src="F:\JRiver Data\Images\AV\1024x3.png">

It will not show in Zelda but it will show in JRiver

If I remove the .png in the file name <img src="F:\JRiver Data\Images\AV\1024x3">

It will show in Zelda but will not show in JRiver. 

So, I need to have in defined as a .png to show in JRiver but only shows in Zelda without the .png

Thanks for all your work on the program, it's helped me out quite a bit.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on December 14, 2020, 04:29:42 pm
Thanks mvandyke,

Yes, that's a bug caused by a recent-ish change in MC. When I wrote that code MC was only accepting PNGs, and it only accepted paths without the .png extension. Now they added support for JPG, BMP and possibly others, so the extension must be there... EXCEPT on the "Tooltip:" folder, where for some reason the .png must still be removed.

I'll do some extra testing and publish a fix next week.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on December 14, 2020, 07:50:31 pm
Thanks mvandyke,

Yes, that's a bug caused by a recent-ish change in MC. When I wrote that code MC was only accepting PNGs, and it only accepted paths without the .png extension. Now they added support for JPG, BMP and possibly others, so the extension must be there... EXCEPT on the "Tooltip:" folder, where for some reason the .png must still be removed.

I'll do some extra testing and publish a fix next week.

Thanks so much.  Appreciate all the hard work and updates that you've provided.  I know that I could not have done my project without your help and the tools that you've provided.

Matt
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on December 21, 2020, 04:42:58 pm
Published Zelda v1.2.5: [source code changes (https://github.com/zybexXL/Zelda/commit/1f8d1ba65db13d5cc89ac1ccb128b734f8d984bf)]:
- Fix PNG in "tooltip:" folder (remove extension)
- Add support for JPG/BMP/GIF/TIF images
- Add ListMix2()

To upgrade, you can just start Zelda and click on the "new version available" label on the status bar. Alternatively, get it here (https://github.com/zybexXL/Zelda/releases/latest).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on December 22, 2020, 06:44:55 am
Thanks for the update.  Will install and report back.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on December 22, 2020, 10:20:44 am
Some good headway but still a couple of challenges:

If the image files is in Tooltip directory, I can't get Zelda to display the image through Rendered Output with or without the .png

If the image file is in another directory "F:\JRiver Data" then it does display with the .png extension, but does not without the extension.

Here is the test that I did:

<img src="tooltip:1024x3.png">

<img src="F:\jriver data\images\av\1024x3.png">

<img src="tooltip:1024x3">

<img src="F:\jriver data\images\av\1024x3">

the image us just a grey line but you can see in the attached file that it only displays on 2nd one.

Thanks for all of your help.  Let me know if you need more information.

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on December 22, 2020, 10:59:32 am
This works fine for me, using the same filename for the png:
<img src="tooltip:1024x3">

Do you have the file in some subfolder of the .\Data\Tooltip folder? If you, you need to add that to the path like so:
<img src="tooltip:sub1\sub2\1024x3">

If it still doesn't work, perhaps Zelda is misdetecting your Tooltip folder location. Try using the "browse" icon on the "Insert Image" dialog to see what path it's resolving to. You can also override the Tooltip path in Settings. Perhaps you entered something there already? Just leave the option unchecked to use the default Tooltip path (and see what it is).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on December 22, 2020, 12:51:47 pm
This works fine for me, using the same filename for the png:
<img src="tooltip:1024x3">

Do you have the file in some subfolder of the .\Data\Tooltip folder? If you, you need to add that to the path like so:
<img src="tooltip:sub1\sub2\1024x3">

If it still doesn't work, perhaps Zelda is misdetecting your Tooltip folder location. Try using the "browse" icon on the "Insert Image" dialog to see what path it's resolving to. You can also override the Tooltip path in Settings. Perhaps you entered something there already? Just leave the option unchecked to use the default Tooltip path (and see what it is).

It was the configuration in Zelda.  I specified another directory as some point and when I removed the checkbox - all worked OK for the tooltip- file without the extension (.png).  It will only display files that have the .png extension if they are outside of the tooltip directory path.  I can easily work with that as I understand the rules now.

Thanks so much for all of the hard work!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on December 22, 2020, 12:57:12 pm
Good :)
You can still have non-PNG files in the tooltip folder, but then you need to specify the full path (doesn't work with "tooltip:" in MC).
Like so:
<img src="C:\Program Files\J River\Media Center 27\data\tooltip\logo.jpg">
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 01:22:11 am
Zelda gives different results from MC for this:
Code: [Select]
regex([Name],/#(?=:)(.*)#/,-2)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 05:55:15 am
That's very unlikely (but not impossible), as Zelda is only passing the expression to MC for evaluation and then displaying the returned value unmodified. The only way I can think of where they could differ is if the evaluation codepath in MC is different for UI evaluation versus API evaluation. It's possible, but then it would be an MC bug.

I can't reproduce it on MC 27.0.47. Can you provide a sample [Name] where you see this happening, and what are the results shown in MC and in Zelda for that string?

Starting a regex with a positive lookahead is unusual, perhaps MC's regex engine is producing non-deterministic output because of that. The expression you wrote is basically the same as "(:.*)", or ": (.*)" if you don't need the colon (had to add an extra space there because the forum was showing it as a sad smiley). Also, mode -2 here doesn't make much sense - the expression will only ever return 1 capture due to the (.*), unless the [Name] has multiple lines of text.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 01:08:09 pm
Squirrels often achieve things that others think are very unlikely (or impossible).   ;D

I didn't say it was a good regex. It's just some intermediate junk I accidentally had in there while testing something.  It's the fact that there was a difference that caught my attention.

Here's a [Name]
Code: [Select]
Cello Suite 4 in E-flat major, BWV 1010: I. Prelude
Note the leading : (followed by a space) in the MC output, which is absent from the Zelda output.
Interestingly, and also impossible, both MC and Zelda consider the length of their output to be 12.  12 is the wrong answer for the output displayed by Zelda.

You can test that with this:
Code: [Select]
regex([Name],/#(?=:)(.*)#/,-2) Length(regex([Name],/#(?=:)(.*)#/,-2))
Here's the comparison:
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 01:52:36 pm
Interesting. It shows correctly for me, with the leading colon. The length check also confirms that the colon is there... only not visible to you for some reason. Does the colon show up if you just type ": something" in Zelda? This issue would not be caused by any given expression or function, so just trying to print the text directly should also have the same result.

2 or 3 possibilities occur to me:
- did you change the Font in Zelda settings? If so, try another one with "regular" style, size 10 or 12. Default is "Consolas 10, regular"
- Are you sure that's a regular ":" symbol and not a visually-identical unicode colon? If it's a non-standard colon symbol, then the selected font in Zelda must have it, or it won't be rendered. Changing the font could also fix it in this case.
- do you have any Zoom/Scaling factor enabled in windows? If so, can you tell me exactly which settings you use so I can try replicating it - there are several ways to enable Scaling in Windows 10, and some of then interfere quite heavily in how text is rendered by applications.

Also try a string with multiple colons like "::: test ::: test :::" to check if it's all colons being suppressed (font issue) or just the leading one.

Is the colon supressed both in the Playlist (datagrid) and "Text Output" tabs, or just in the Playlist tab?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 02:49:24 pm
I didn't think to do the tests you suggested on the other tabs. Interesting results.

Although I never changed any font settings for Zelda, when I went into that dialog, the default was set to Consolas 11 regular, if that is noteworthy.  I tried changing the font settings, and that had no effect.

It happens in all the tabs, not just the playlist tab.

The leading colon is suppressed if it is followed by a space. If it is followed by almost any other character (including another colon), it is not suppressed and everything is fine. Colon followed by / and a space (an escaped space in MC parlance) is also suppressed. So
Code: [Select]
:/ T displays
Code: [Select]
T
An arbitrary number can be suppressed, as long as they are at the start of line 1:
Code: [Select]
: : : test ::: test ::: Tdisplays as
Code: [Select]
test ::: test ::: T
A colon space that starts an additional line after a carriage return (line 2) is not suppressed. It only happens at the start of "line 1" in the input field.

It's interesting to watch, if you type colon space T
You see the colon appear, then the space is invisible of course, then you hit T and you see the colon disappear and the T shifts over to the left to the start of line where the colon was. Same effect for colon space / T

I'm running Zelda 1.2.5 from the zip, not the installer, on Window 7x64. No zooming, no scaling, normal EN/US, and of course it's a regular colon.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 03:06:33 pm
Thanks, now I managed to reproduce it too.
The key is that it needs to be at the start of the string (line 1). When I do my tests I usually reuse the same Zelda panel so it's common to have other expressions above... I was testing your case on line 10 of my test tab #15 :)
Also, you're right, the default is Consolas 11, not 10.

This is a bug in MC - it's the "unlikely" case I outlined above.

@Matt,
Can you please check why this happens on the COM API but not on MC's UI:
file.GetFilledTemplate("test")      = "test"  (correct)
file.GetFilledTemplate(":test")     = ":test" (correct)
file.GetFilledTemplate(": test")    = "test"  (wrong)

Thanks, and happy new year!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 03:30:18 pm
This reminded me of another recent oddity I found and mentioned here (https://yabb.jriver.com/interact/index.php/topic,127995.msg888151.html#msg888151) - The string "()" will get suppressed from any expression or field output:
Code: [Select]
file.GetFilledTemplate("test()")    = "test"  (wrong)
Here I can understand the reasoning - the EL Engine thinks that we are referencing a Test() function which doesn't exist, so it just returns "test". However on the UI this does not happen so I think the API should also return "test()" for consistency.
Worst, this happens when simply outputting any field value which contains "()":
Code: [Select]
save(/#test(), (), test2()#/, v_test)
[v_test]

This outputs "test, , test2" when using the API, and "test(), (), test2()" when using an Expression column on MC.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 03:49:31 pm
See, this is perhaps why you should not want me to use your app...   ;D

This thing I just reported, was literally my first time using Zelda. First time I ran the app.

Everything you just mentioned as "another recent oddity" I have never tried using the API. Presumably I'll stumble over those on my 2nd use.

Overall though I like it Zybex. Nice job. I'd like it better if you could drag to re-order tabs, and to re-order columns in the playlist view.  I especially like what you did with insert function, and with the live wiki below the editing pane. That's nice. It would be good if the Insert Function dialog had grouping like the wiki to make it easier to find things (String Functions, List Functions, etc).

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 03:51:00 pm
Matt,
Looks like the GetFilledTemplate() is adding an extra Clean() to the expression. Doing this on MC UI exactly reproduces the behavior we're seeing on the API/Zelda.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 03:55:49 pm
See, this is perhaps why you should not want me to use your app...   ;D
Nonsense, where would developers be without users that could find the bugs we intentionally put in there?  ;D

Quote
This thing I just reported, was literally my first time using Zelda. First time I ran the app.
Everything you just mentioned as "another recent oddity" I have never tried using the API. Presumably I'll stumble over those on my 2nd use.
Cool, feel free to report any issue you encounter.

Quote
Overall though I like it Zybex. Nice job. I'd like it better if you could drag to re-order tabs, and to re-order columns in the playlist view.  I especially like what you did with insert function, and with the live wiki below the editing pane. That's nice. It would be good if the Insert Function dialog had grouping like the wiki to make it easier to find things (String Functions, List Functions, etc).
The Insert Function dialog does have a "Category" column which matches the Wiki, you can sort by that. Better yet, just type "list" or "string" on the search panel to quickly filter the list.
Tab/Column reorder: added to the TODO.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 04:07:52 pm
The Insert Function dialog does have a "Category" column which matches the Wiki, you can sort by that. Better yet, just type "list" or "string" on the search panel to quickly filter the list.
I was thinking more of some links above the list that would automatically jump or even better filter to the desired section. With the column, you have to click to sort, and then scroll through the list to find what you want. The type-filter is good, but it's keystrokes. It's just easier/nicer to be able to pick from a "menu".

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 01, 2021, 04:33:01 pm
Perhaps a dropdown to filter by category, with "all" as the default? Having links is doable, but it's ugly to put 11 individual links there.
Did you see the last post of page 2? Looks like an extra Clean() is the culprit.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: wer on January 01, 2021, 04:47:46 pm
That could work.  But there are only 11 categories, 12 if you count all.  So a set of text links in a small font (or buttons if you think it looks better) above the table would provide for very quick filtering and a nice visual reference.

All      Cat1      Cat2      Cat3      Cat4      Cat5
Cat6     Cat7      Cat8      Cat9      Cat10     Cat11


Yes I saw about Clean(). Hopefully it will be an easy fix.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: DJLegba on January 03, 2021, 10:36:45 pm
Thanks for this tool, I found it very helpful.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 04, 2021, 04:11:06 am
You're welcome! Happy new year.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 21, 2021, 10:17:35 am
Published Zelda v1.3.0: [source code changes (https://github.com/zybexXL/Zelda/commit/0ac096a4b4569f859f46cdaccc726ca3e4bffcc3)]:
- Updated function list
- Reworked settings layout
- Added category filter to Insert Function
- Added empty filter to Insert Field

To upgrade, you can just start Zelda and click on the "new version available" label on the status bar. Alternatively, get it here (https://github.com/zybexXL/Zelda/releases/latest).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: marko on March 21, 2021, 11:09:00 am
The wiki links for Counter(), Math(), Number(), Rand(), Range(), StackCount() and TrackNumber() need to be updated.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 21, 2021, 11:46:48 am
Thanks Marko! I knew I forgot something... maybe I should've used your new URL aliases, but I'm afraid that they will not be updated in the future.

Published v1.3.1, fixing URLs for functions in the Number category.
https://github.com/zybexXL/Zelda/commit/ab21346330351bec10868c97d988f07cf67f5d72
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 08:23:24 am
Hi zybex,
If you have time and motivation could you add opacity and valign support for font :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 09:13:33 am
Is Font valign supported in MC? It's not on the documentation:
https://wiki.jriver.com/index.php/Expression_Language#HTML_Font_Properties

Zelda already supports the Font Alpha attribute for opacity. I haven't tested much though, not sure if it renders the same way as within MC.
There's a valign on the img tag, though the HTML rendering in Zelda doesn't match 100% with MC - close enough until someone complains ;)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 01:01:10 pm
Alpha doesn't do anything for me in Zelda i.e. cannot make text invicible in the renderer window. Font valign is implemented. I requested it maybe year ago and got a hit.

I have noticed that image rendering doesn't match but haven't complained about it  ;D Would be a time saver if it would be closer but not complaining...
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 02:13:12 pm
Alpha works for me and the renderer output matches what I see on MC. Alpha=0 makes the text invisible.
Can you paste some expression using Alpha, and screenshots of how it looks for you in MC and Zelda?

I'll test and add Font valign, thanks for letting me know.
Regarding image valign... even in MC it doesn't work very well, specially when mixing text and images on the same line.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 02:49:26 pm
I'll test and add Font valign, thanks for letting me know.
Regarding image valign... even in MC it doesn't work very well, specially when mixing text and images on the same line.
there are definitely bugs in MC renderer. font align helps a little there. There is a bug in MC also when Theaterview is rendering text which is not default size. The first and the last row have much more vertical space between the lines


Alpha example. See in picture that alpha="0" marked text is displayed. (using those to be able to align horizontally) in MC alphas are invisible. So it should show only 6,8/10 not 6,8/100
And on lower row "6,8/10" should be invisible
Code: [Select]
<img src="tooltip:CriticRating//imdb-square_top" width="40" valign="bottom">/
/  <font face="Hack" size="90" valign="bottom" alpha="80"><b>FormatNumber([IMDB Rating],1)<//b><//font>/
<font face="Hack" size="70" alpha="50" valign="bottom">//10<//font>/
<font face="Hack" size="70" alpha="0">[v_IMDbVotes]Repeat(/ ,Math(6-Length([v_IMDbVotes])))<//font>/

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 03:11:35 pm
Hmm, I can't reproduce, it works fine for me. What do you get with this?

Code: [Select]
<font size="200" alpha="100">sample text<//font>
<font size="200" alpha="60">sample text<//font>
<font size="200" alpha="30">sample text<//font>
<font size="200" alpha="0">sample text<//font>
<font size="200" alpha="40">sample text<//font>
<font size="200" alpha="70">sample text<//font>
<font size="200" alpha="100">sample text<//font>
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 03:17:37 pm
strange
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 03:18:36 pm
is there some legendary zelda option which i don't have activated
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 03:23:51 pm
Really strange. It looks like the IE .Net component is not rendering opacity for you... so it's either a different version than what I have, or redirected to another renderer somehow (Chromium?). Even the rest of the text on your first screenshot looks weird, not the same as what I see... it lacks aliasing for one. It shouldn't matter if you use Chrome/Edge/Firefox, the .Net renderer should be independent :/

I assume you are on Windows 10 with .Net 4.7 or above installed?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 03:31:06 pm
win10, regex says .net version is 4.8.04084
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 03:34:58 pm
Does your country/PC write decimals as 1.00 or 1,00? Second one?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 12, 2021, 03:50:42 pm
yes, i live in comma world. Though in English Windows 10 it seems to be more confused than 7 was with regions and languages. Calculator worked with commas and also in mc i need to replace commas with periods when doing math
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 04:07:45 pm
That's it then - Zelda is generating this HTML for alpha - notice the dots on the Opacity values:
Code: [Select]
<span style=" font-size: 200%; opacity: 1.0;">sample text</span><br>
<span style=" font-size: 200%; opacity: 0.6;">sample text</span><br>
<span style=" font-size: 200%; opacity: 0.3;">sample text</span><br>
<span style=" font-size: 200%; opacity: 0.0;">sample text</span><br>

On your country those are getting printed as commas, so the browser fails to parse it and ignores it :-X
I've fixed it already and will publish soon.

Thanks for spotting it!
 
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 12, 2021, 04:15:41 pm
Published Zelda v1.3.5:
- Fix Opacity/Alpha for countries using comma for decimals
- Added Treenode, Extract, PlayListTime functions

Please upgrade (restart Zelda, click the upgrade notice on bottom corner) and let me know if it fixes opacity for you.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 13, 2021, 02:22:05 am
Oh right, didn't remember that opacity is decimal number outside of MC language... Anyway it is now working thank you for the fix.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 13, 2021, 05:18:33 am
Good :)
Is the rendering in Zelda close to the rendering in MC? Font sizes, images, alignment, etc?
If not, could you send me a full screenshot of how your tooltip looks in MC and in Zelda, and the full code for your tooltip? I could try to iron out the details. PM or email is fine.

A Library backup would work even better as it would contain all your fields/expressions.
With my tooltip it looks almost 100% correct, but perhaps yours is more complex.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 13, 2021, 06:41:22 am
It looks about the same. I'm mostly doing theater view screens and there the difference was zooming. I have set it to 80%. There was some reason why it isn't 100% but I can't remember what was and is that reason valid anymore... also theater view renders a little bit differently than tooltip. Zooming only affects text not images on theater view while Zelda zooms both.

E: How to reset zoom in Zelda?

E2: I think that unzooming to 80% in Theater View is related to that Theater View font size must be 12 and that is too big for basic text
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on May 13, 2021, 07:16:33 am
On the Expression and 'Text Output' tab, use CTRL+MouseWheel to change zoom. Current zoom level is displayed on the statusbar and is saved/persistent.

On the ' Rendered Output' tab, Zoom is handled by the browser component. You can also change it with CTRL+Wheel but there's no indication on the statusbar (Zelda doesn't receive any notification...). Restarting Zelda resets this zoom to 100%. CTRL+0 doesn't work for some reason, maybe I'll look into it later.


Can't you change the default font size for TheaterView? You can also use <font size="80"//> at the start of your expression. This should then match the rendering with Zelda.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on May 13, 2021, 07:54:54 am
I can't change base font size in TV so I would have to always use font tag when I want to display anythin at my "base font size" also then I couldn't use any stock field for display but everything must be expressions so I can set that "my base font size". It would be too cumbersome even on MC's modifying the look standards. (it is already too much work to try to change how TV looks.. like doing the layouts using invisible monosize font to get it display things at correct place  ;D)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Chipicui on June 29, 2021, 04:52:13 pm
zybex
I'm really sorry to bother you but I'm having an unhandled exception starting zelda on windows 7 64 bits.
Any idea why this could happen?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on June 30, 2021, 04:48:03 am
Hi Chipicui,
Please install .NetFramework Runtime 4.7.2 or above, you're likely running an older version.
https://dotnet.microsoft.com/download/dotnet-framework
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Chipicui on June 30, 2021, 01:27:14 pm
Thanks zybex!
I'll do it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Chipicui on June 30, 2021, 04:58:01 pm
That was it... it works perfectly now. Thanks a lot!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: InflatableMouse on July 24, 2021, 08:12:04 am
I have a small suggestion. The wiki page shows the correct expression (it jumps to the right spot on the wiki page). I noticed however its possible to scroll up and down and it actually shows the the entire wiki page. I didn't realize and got lost because its quite a long page.

I was wondering how you felt about loading only the part of the expression that is used? Im not sure how to explain this, I think it should be possible to load the "index" in an iframe.

I hope I made that clear enough to make sense :).

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on July 24, 2021, 09:09:55 am
Yes, the browser panel just loads the corresponding wiki page and cleans it up a bit, but most of the page is still there. You can still scroll and click around, and if you're crafty enough you can even end up on youtube or something like that ::)

However, all you have to do is click on some other function (of the expression you're writing) and then again on the function you want, and it will reload the page at the correct location again, so I felt it would be OK to leave it like that instead of trying to scrape just the needed function text from the original wiki page, which can be error prone. Being able to scroll up/down to see related functions might also be useful, I think.

One other way to jump back to the function you want: click the Booklet icon on the toolbar twice (turn Off/On the wiki)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: InflatableMouse on July 25, 2021, 02:29:57 am
However, all you have to do is click on some other function (of the expression you're writing) and then again on the function you want, and it will reload the page at the correct location again, so I felt it would be OK to leave it like that

Yeah, its oke and it works fine. I felt it would be more convenient if it loaded just that expression thats all.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on September 24, 2021, 11:57:20 am
Have I said lately how much I love this tool? I seriously love this tool.

I do have one minor "bug" report, though: The FieldQuery help is redirecting to an Interact thread, but the function is in the wiki.

And one semi-major feature request? I was just contemplating writing this myself but thought I'd toss it your way to see if it's something that would fit better into Zelda, since you already have all of the building blocks in place already.

So the idea was a library performance analyzer. It would read in all of MC's user-defined fields, and for each field it would load in the values for every file in the library and record the amount of time it took MC's API to perform the task. Once it's completed this for every user-defined field in the database it presents a report that lists them all alongside their time. It would take some time to run, for sure, but it would help find problematic expression fields that are having the heaviest impact on MC's performance.

The idea really came from Zelda, since it already reports on the timing of individual expressions on a per-file basis. I was just hoping to take that capability and use it to get a birds-eye view of the entire library to see which expressions might be causing MC to periodically become temporarily unresponsive.

Thoughts? Even if it's not something you're interested in adding to Zelda, given your experience in this area, do you think the idea is feasible and worth pursuing?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 25, 2021, 11:53:26 am
Thanks for the love  ;D

Funny, I thought I had published the updated wiki links, apparently not. I'll review the list of functions and add a few new ones, then I'll publish an update.

Regarding your idea for a performance analyzer... it's feasible. You can already measure a given field by simply writing it on the left side, eg. "[tooltip]", and then see the API time for each file in the Playlist tab on the right side. Doing the same for all fields... what about simply adding a similar "API" timing column to the "Insert Field" button? It already fetches the value of each field for the current file, so it would be trivial to add the timing there.

A full matrix of "all fields" vs "all files" is a bit cumbersome, I think.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on September 25, 2021, 11:22:16 pm
Ah, the idea wasn't to show a matrix of all fields and files. Sorry I wasn't clear. It would just be a two-column table showing field name and average response time.

So, for example, if I have a field that is constantly causing MC to go semi-unresponsive this would help locate that field by allowing you to compare the impact of that field against that of other fields. Currently, the file list shows the API response time of a single expression run against a single file. The idea is to get a report of the average impact of all fields, using some subset of the total library as a dataset, so that comparisons could be run between all user-defined fields to find the heaviest hitters.

Using that information, a user could sort the output by response time and find the expression fields that are really hammering on MC and causing potential performance issues.  I assumed it won't make sense to bother with default fields since a user has no control over those.

I think we're on the same track there with what you're suggesting about the Add Field window. The only difference would be that this would do the same for the entire list and present the average response time instead of single-file response time.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on September 26, 2021, 09:32:50 am
Published v1.40:
- Add SetField and ListFilter functions
- Add missing wiki links
- Refresh Playlist tab only when it's the current tab
- Refresh only values of visible expressions on Playlist tab

The performance analyzer goes into the TODO. I checked it today, and MC's API doesn't provide any info about a field type - so I have no way to select only the user-created fields. This means the analyzer would need to list all fields, or provide a way for you to select which fields you want to analyze.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on September 26, 2021, 09:40:04 am
The performance analyzer goes into the TODO. I checked it today, and MC's API doesn't provide any info about a field type - so I have no way to select only the user-created fields. This means the analyzer would need to list all fields, or provide a way for you to select which fields you want to analyze.

Oh, bummer. Another option would be to maintain an internal list of stock fields and then filter those out? But I'm happy to hear the idea has merit and is under consideration!

Confirmed the wiki link for FieldQuery is working now! Thanks!
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: john greenwood on January 13, 2022, 05:41:08 am
Newbie question here.  So far I have only used Expressions singly (e.g. rules for inserting text into fields).  I would be interested in creating mini-programs. I assume your program has a way to save a function I have created. But how do I call a function within JRiver?  Couldn't find the answer in the Wiki.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on January 14, 2022, 03:40:05 am
MC doesn't have the concept of functions, it's all inline code. There's no way to have a library of functions.
You can however have field [AA] which is a calculated field with some expression, and then use [AA] as part of another expression on field [BB].

Zelda saves all tab contents automatically on exit and restores them at startup, but it does not save them to MC.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 22, 2023, 05:27:04 am
Published v1.4.1:
- Comment out lines starting with ##
- added option in Settings to enable/disable comment lines
- Add Decimal() function

You can now comment text or code lines by starting the line with ##, as shown in screenshot below. Note that while these lines will be ignored in Zelda, you need to remove them before putting the code in MC as they will not be ignored there.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 22, 2023, 08:57:50 am
Thanks for update. Commenting is a good addition. Any chance to get dark mode color preset. I know you can change some colors but hard coded colors doesn't easily play with darker backgrounds
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 22, 2023, 10:13:22 am
I can add a Dark mode theme, but it actually requires quite a few changes and testing time, as it's not just a matter of flipping a switch and let windows do it. Many icons will also need a dark variant. I'll get to it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 11:42:20 am
Published v1.5, adding support for MCWS connection. This means that you can now connect to a Linux/Mac server too, even if the tool still only runs under Windows.

Zelda v1.5.1 (25.03.2023):
- Add MCWS connection support
- Save/Restore window size and position
- Update Scintilla.Net control

Reminder: Zelda has an auto-upgrade feature, just click the red "new version" notification on the lower-left corner.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 01:03:42 pm
Thanks for update. MCWS doesn't seem to find all my playlists. Namely my Test list is missing. It reappears if I change to automation object
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 02:10:27 pm
Is it a smartlist or playlist?
Can you please share the playlist definition and full path?

Also, does it show up in this browser call?
http://<yourHostname>:52199/MCWS/v1/Playlists/List

... and does it look something like this?
Code: [Select]
<Item>
    <Field Name="ID">649401942</Field>
    <Field Name="Name">fix</Field>
    <Field Name="Path">Categories\fix</Field>
    <Field Name="Type">Playlist</Field>
</Item>
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 02:31:55 pm
It is playlist. If I duplicated it then the TESTI was found but no items for it and the duplicate TESTI (1) was not found at all

MCWS itself founds it. Location is Playlists root

<Item>
<Field Name="ID">743619254</Field>
<Field Name="Name">TESTI</Field>
<Field Name="Path">TESTI</Field>
<Field Name="Type">Playlist</Field>
</Item>
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 02:42:46 pm
(ಠ_ರ) ?

What do you get for this one?
Code: [Select]
http://<yourHostname>:52199/MCWS/v1/Playlist/Files?playlist=743619254&action=JSON&fields=key,date,date%20imported,date%20%28release%29,date%20%28year%29,name,filename,file%20size,media%20sub%20type,media%20type
Actually, please check the logfile in %TEMP%\Zelda, maybe there's an Exception logged there. It's possible it's some char in one of your filenames/metadata causing a decoding issue.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 02:45:15 pm
it returns the content of the playlist
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 02:46:35 pm
I edited my reply, sorry. Can you please check the logfile to see if there's an Exception logged?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 02:50:19 pm
UI proof...  ;D
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 02:56:04 pm
No errors in the log

21.53.02.333  Detected MC install folder: D:\audio\MC30\
21.53.25.024  Connecting to JRiver
21.53.25.025  Checking connection
21.53.25.025  Connect: getting existing MediaCenter instance
21.53.25.027  Checking connection
21.53.25.029  MediaCenter version 30.0.87, APILevel=2
21.53.25.029  MediaCenter library is 'Main Library', path=C:\Users\xxxxxxx\AppData\Roaming\J River\Media Center 30\Library\
21.53.25.030  getFields: loading 707 fields
21.53.25.705  getPlaylists: loading 260 playlists
21.53.25.832  getPlaylists: finished
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 03:00:45 pm
Do you have something in Settings -> Preferences -> Playlist Filter ?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 03:06:42 pm
attached
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 03:11:52 pm
I'm going to walk the dog now, see if I can think of something...
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 25, 2023, 03:54:36 pm
No worries. I can use automation object just fine. Just thought I report my finding
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 25, 2023, 04:18:45 pm
Version 1.5.2 is now published with a fix. Thanks Lepa for testing it!
The issue was caused by negative playlists IDs, which I forgot existed.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on March 26, 2023, 08:12:41 am
there seems to be some refresh issues though. If I remove/add some items to my test playlist it confuses Zelda and reloading doesn't solve the issue
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 26, 2023, 10:26:08 am
Can't reproduce that. It works for me both with Automation and MCWS - I added files to a playlist, hit reload, and the files showed up on the list.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Moe on May 10, 2023, 10:02:16 am
I really love Zelda, it's made my life so much easier when creating complex expressions.

That said, there is one feature I would like.  I would love to be able to copy and paste from the wiki preview.  I am not sure if it's possible, but it would be a huge QOL improvement for me as I've lost count the number of times that I've tried to do it  ;D

Thanks
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: markf2748 on July 08, 2023, 08:40:22 am
I really love Zelda, it's made my life so much easier when creating complex expressions.

That said, there is one feature I would like...
Agreed nice to have, but even more important for me is to add copy/paste from the right hand output window.
Use case:  Documentation, especially for posting MC error reports to the Interact forum.  Currently I have to hand copy the error output, which can be painful and error prone itself.

Update:  I just discovered Copy/Paste is in fact available from the Text output window.  It is only not available in the Rendered Output window, even though Zelda highlights mouse selections there, as if for copy.  So a little misleading.

Another documentation-related, ease-of-use issue:  closed parenthesis within a comment line cause Zelda to omit the word from its right-side output window.
Example:
!* broken swap() *!  ==> !* broken *!

As always, thanks for a really great utility.

Win 11 64-bit  MC 31.0.32  Zelda v1.5.2
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: blgentry on August 04, 2023, 07:45:23 am
Sadly I can't try Zelda because it only runs on Windows.  I have no Windows machines in my inventory at home or at work.

That said, this is an exciting project.  Years ago I talked about the idea of developing a "toolbox" of expressions.  Things you would use for various purposes inside of MC and be able to share with others.

Does Zelda allow you to save your expressions locally?  Is there a concept of developing libraries of MC expressions, or at least "modules" which you could share with others?

MC's saved views has some of what I'm discussing, but the mechanics of saving and sharing views are very difficult for those that are not deeply familiar with MC.  I'm hoping that Zelda might fill some of the functionality of collaborating and sharing MC expressions.

There's a tiny possibility that I might get an x86 emulator working on one of my Macs just to try this.  Maybe....

Really neat project Zybex.  :)
Brian.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 04, 2023, 11:38:16 am
Agreed nice to have, but even more important for me is to add copy/paste from the right hand output window.
(...) It is only not available in the Rendered Output window, even though Zelda highlights mouse selections there, as if for copy.  So a little misleading.

I'll enable copy/paste in the documentation and rendered output panels.

Quote
Another documentation-related, ease-of-use issue:  closed parenthesis within a comment line cause Zelda to omit the word from its right-side output window.
Example:
!* broken swap() *!  ==> !* broken *!

AFAIK, MC does not have a way to comment out an expression line. Where is this !* escaping from?
What's happening there is that the swap() is a valid function, so it gets executed and replaced with its blank output (so swap() is removed from the output). This is done by MC, not Zelda.

I could add these type of comment lines in MC, but they would need to be stripped before using in MC. There's actually a silly workaround to add comments to MC that is recognized by Zelda:
I forgot I had added a way to comment lines in Zelda - just start a line with ##. Commented lines are ignored, not shown on the output.
## this is a comment, and is highlighted by Zelda

Quote
As always, thanks for a really great utility.
You're welcome.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 04, 2023, 11:49:46 am
Sadly I can't try Zelda because it only runs on Windows.  I have no Windows machines in my inventory at home or at work.

Have you tried running it with Mono under KDE or Gnome?
I'll look into porting it to .Net7 + MAUI which should run on Linux, but that may be too much work.

Quote
That said, this is an exciting project.  Years ago I talked about the idea of developing a "toolbox" of expressions.  Things you would use for various purposes inside of MC and be able to share with others.

Does Zelda allow you to save your expressions locally?  Is there a concept of developing libraries of MC expressions, or at least "modules" which you could share with others?

I proposed this Modules feature to MC team, but there's no traction:
https://yabb.jriver.com/interact/index.php/topic,124543.msg877195.html#msg877195

Update: That was an old proposal, I've since updated it with a simpler solution (Beta members only):
https://yabb.jriver.com/interact/index.php/topic,135200.0.html

Zelda saves the expressions locally only. I've thought several times of using some MC forum thread to collect snippets and functions, but what would really work was that solution I highlighted on that thread.

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on November 04, 2023, 03:55:42 pm
Published Zelda v1.5.5 (04.11.2023):
- Allow CTRL+C and ContextMenu in Wiki and Rendered output panels
- Detect and highlight saved variable names
- Tweak color scheme
- minor bug fixes

https://github.com/zybexXL/Zelda/releases/tag/v1.5.5

Reminder: Zelda has an auto-upgrade feature, just click the red "new version" notification on the lower-left corner.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 11, 2024, 01:42:24 pm
Hi zybex,
If could suggest couple keyboard shortcuts:
- ctrl-w to close tab
 - perhaps also some shortcut to create new tab

- ctrl-shift-z to undo in addition to ctrl-y
  - background for this that I sometimes mess up my undo history when going for ctrl-shift-z which many programs support
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 11, 2024, 04:07:51 pm
Sure. Ctrl+W to close, CTRL+N to open.

Ctrl+Z iand Ctrl+Y are already there - do you want Ctrl+Shift+Z to do the same as Ctrl+Z ?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 11, 2024, 04:39:25 pm
do you want Ctrl+Shift+Z to do the same as Ctrl+Z ?
Ctrl+Shift+Z is redo like ctrl-y in many apps so i have it on my muscle memory.

so ctrl-z undo and ctrl-shift-z/ctrl-y redo

E: made it bit more clear  ;D
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 11, 2024, 05:41:19 pm
Published Zelda v1.6.0:
- Fix: Shift+Click on the wiki browser opens a link on the default browser
- Added FileExtension function
- Added several keyboard shortcuts:
  - Ctrl+N to open new tab, Ctrl+W to close tab
  - Ctrl+B/I/U to insert bold/italic/underline tag
  - Ctrl+Shift+Z for Redo (same as Ctrl+Y)
  - F1 for Help/About
  - F2 to rename a tab
  - F3/F4 to open the Insert Field/Function dialogs
  - F5 to pause/resume automatic execution
  - F9 to open settings
  - F11 to toggle Maximized window

https://github.com/zybexXL/Zelda/releases/tag/v1.6.0
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 12, 2024, 08:40:48 am
My muscles thank you  :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 15, 2024, 04:34:41 pm
Published Zelda v1.7.0:
- New: Linked Fields - load/save directly to MC calculated field 8)
- New: Highlight all instances of selected word (double-click)
- New: Drag expression tabs to reorder them

- New: keyboard shortcuts for linked tabs (CTRL+L/S/R)
- New: keyboard shortcuts to change current file (ALT+Left/Right)
- New: Colorize tab headers to indicate status
- Change: Enlarge toolbar buttons, use new icons
- Change: Tweak highlight colors
- Fix: Apply current Wrap/EOL setting to new tabs
- Fix: prevent scroll position jumps when word-wrap enabled

https://github.com/zybexXL/Zelda/releases/tag/v1.7.0


Finally linked Zelda directly to MC Fields :)
This works only with MC 32.0.18 and above, and it must be connected with MCWS, not Automation mode (change in Settings). You must provide a valid user/password to be able to save the field back to MC.

(https://raw.githubusercontent.com/zybexXL/Zelda/master/Screenshots/Zelda170.png)

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: mvandyke on February 15, 2024, 04:53:22 pm
Thanks for all of your hard work on this project.  It really does help out a lot !

Will install over the weekend and look forward to using it.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 16, 2024, 02:56:54 am
Very nice update, thanks zybex
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 16, 2024, 04:02:34 pm
Thanks guys, enjoy.
Minor cosmetic update:

Published Zelda v1.7.2:
- Fix cropped toolbar icons with some DPI settings
- Sharper icons, no resizing
- Add CTRL+1 to 9 shortcuts to change tabs
- Don't open same field multiple times (unless CTRL pressed)
- Workaround for text-wrap bugs causing occasional full color lines
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 21, 2024, 12:24:05 pm
If it is possible could you try to update align zelda's vertical spacing rendering with MC32?
https://yabb.jriver.com/interact/index.php/topic,135179.msg958746.html#msg958746

Thanks for consideration
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 21, 2024, 01:08:39 pm
Hi Lepa,
I was following that discussion and thinking about it. The problem so far is that there's no clear ruleset of how valign is applied, it depends on context. What rules should it follow then? Zelda basically converts the code into standard HTML tags. It was difficult to get it (sort of) right the first time, because MC does NOT follow standard HTML/CSS rules.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 21, 2024, 01:33:02 pm
Yeah understood, no worries. It is still close enough
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 21, 2024, 01:47:32 pm
Send me the code you used here (https://yabb.jriver.com/interact/index.php/topic,135179.msg958761.html#msg958761) and I'll try to reproduce it in Zelda. Or even a simpler example.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 21, 2024, 02:01:10 pm
Images are actually quite fine. only scaling sometimes reveals tears. it is the font thingy MC 31 (upper image) vs MC32 (below image) here https://yabb.jriver.com/interact/index.php/topic,135179.msg958488.html#msg958488
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 21, 2024, 02:04:59 pm
hmm.. i can't reproduce it anymore even with text...
<font bgcolor="DD00DD">test<//font>
<font bgcolor="DDDDDD">test<//font>

looks like MC32 to me
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: lepa on February 22, 2024, 03:05:48 pm
altgr+8, altgr+9 has started to do some strange things for me. Zelda will insert [ or ] but also jumps to different tab.... :o
E: It stopped doing that when I closed some tabs
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 22, 2024, 03:31:38 pm
That's due to the new Ctrl+Number shortcuts that switch directly to a given tab number. Because AltGr = CTRL+ALT, it's being wrongly captured. If you have less than 8 tabs then AltGr+8 works fine :)

Fixed here (https://github.com/zybexXL/Zelda/commit/6c9e9f85bec108958cc1a2bc2a33530b950e9034), will publish in the weekend. Thanks for the report.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 23, 2024, 03:00:50 am
Published v1.7.4 with the fix for AltGr+Digit triggering the tab switch:
https://github.com/zybexXL/Zelda/releases/tag/v1.7.4
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: comox on February 23, 2024, 12:42:42 pm
Windows 11 reports serious security threat in 1.7.4.  Warning is strong enough that I would not override. Prior Zelda versions were ok.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 23, 2024, 01:24:54 pm
Hi comox,
I don't really care anymore. Even MC is having trouble lately:
https://yabb.jriver.com/interact/index.php/topic,138245.msg958966.html#msg958966

It's an industry wide problem at this point, and there are no good solutions. I can't force you to trust me. You can always pull the code from Github and compile yourself, that's what open source is for.

For what it's worth, here's the online scan for v1.7.4 - it's [still] relatively clean:
https://www.virustotal.com/gui/file/c7c68073ac181f8cdf015e21580e4c35e76b8ca188b95ee4a866c15b283cd2ba

Here's ZRatings - I got Microsoft to declare it clean, but I'm not about to contact all other 46 vendors...
https://www.virustotal.com/gui/file/645227677ef4a20c16071f94ee1145a9909c79f1585a2018679977d7121c5ddb
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: comox on February 23, 2024, 01:36:21 pm
Sorry, I did not mean to imply I did not trust you.
I see a lot of these warnings and usually override them.
Just wanted to let you know this one was a little unusual.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 23, 2024, 01:37:31 pm
My answer came off a bit strong, please don't take it personally. It's just that there's not much we can do anymore :-/
PS: and in my opinion, you should be wary of trusting strangers on the internet. Better safe than sorry. There's a whole reputation problem that no one has figured out yet how to solve.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: comox on February 23, 2024, 01:42:06 pm
Yes, and I suppose it's possible but not likely that you were deceived by an unsafe library you are using.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on February 23, 2024, 01:42:35 pm
Yes, that can happen. Though it's rare, as most libs come from nuget (microsoft hosted) or compiled from source (peer reviewed). Still happens occasionally, more in the Linux world.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 13, 2024, 04:55:19 pm
Hi guys,
What about a menu item in Zelda to copy syntax-highlighted code to the Clipboard in the BBCode forum format? Any feedback welcome  :)
(Red warnings appear only if needed)

Quote from: ZELDA
Warning: HTML tags mangled for forum display, please re-type <​b>/<​u>/<​i> tags
Warning: ## comment lines included, remove before use
## normal text, numbers, escaped blocks and chars
escaped: // /, /a /b /c /( /)
numbers: 12345, hex number: #80FF00

## functions + symbols, math functions, variables
Isrange(Find(replace(regex([Lyrics],/(\w+/),-2),;,), replace(regex([Name],/(\w+/),-2),;,)),0-10)
math(int([duration])/3600)

## saved variable
save(convertdate(25//01//2010),_date1)
replace([_Date1],2010,2024)

## HTML
<font size="200" color="#00F0FF"><​b>[Name]<//b>

## escaped block
/*char(34)/*
replace(listmix(/#CompareDates([d1],[d2],[L1])#/,0,a;c;d;y;yd),;,char(13))

Or a different style without [​quote]:

ZELDA code snippet:
Warning: HTML tags mangled for forum display, please re-type <​b>/<​u>/<​i> tags
Warning: ## comment lines included, remove before use
## normal text, numbers, escaped blocks and chars
escaped: // /, /a /b /c /( /)
numbers: 12345, hex number: #80FF00

## functions + symbols, math functions, variables
Isrange(Find(replace(regex([Lyrics],/(\w+/),-2),;,), replace(regex([Name],/(\w+/),-2),;,)),0-10)
math(int([duration])/3600)

## saved variable
save(convertdate(25//01//2010),_date1)
replace([_Date1],2010,2024)

## HTML
<font size="200" color="#00F0FF"><​b>[Name]<//b>

## escaped block
/*char(34)/*
replace(listmix(/#CompareDates([d1],[d2],[L1])#/,0,a;c;d;y;yd),;,char(13))


For this to work, I'm inserting zero-width spaces after some <> HTML symbols. For direct copy/paste from the Forum it's still better to use a [​code] block as the HTML entities are not mangled there, but OTOH this makes code readability much better. Colored code snippets can always be attached as an image too, so this is perhaps redundant.

Comments?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on March 14, 2024, 01:25:34 am
Hey there, I'm running MC 32.025 and have Zelda connecting to MC through MCWS. Seems to work fine, I can browse playlists and Zelda evaluates expressions as usual, but when I try to open a linked tab, nothing happens. I get the dropdown menu showing the list of all fields, so that seems to also be working, but no matter which field I select, it never opens a new tab. Any ideas?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 14, 2024, 02:47:29 am
Hi Doof, found the bug. People that already had Linked tabs open from previous versions would not have the problem.

I'll include the fix in the next release. Meanwhile, try doing CTRL+Click on the field name when opening, it should work.
(CTRL+Click allows opening the same Linked field more than once - I added the bug when adding this feature).
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on March 14, 2024, 09:36:46 am
Interesting. Ctrl-Click did work, but I'm not sure about the cause. I didn't have any linked tabs open before this. I only just noticed the feature last night and decided to try it out, and then had to go dig into MC settings to figure out how to enable MCWS.

Either way, I'm glad it works. This is a godsend feature in a godsend utility. Thanks for all the hard work you've done on this.

Edit: Ah, I see what you're saying now. I only ran into the problem because I'd never done it before.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 14, 2024, 05:16:05 pm
Published Zelda v1.8:
- Add BBCode copy function to paste syntax-highlighted code on Yabb forum (see above (https://yabb.jriver.com/interact/index.php/topic,125975.msg960118.html#msg960118))
- Fix opening new Linked tab [thanks Doof]
- Fix some syntax highlight corner cases

https://github.com/zybexXL/Zelda/releases/tag/v1.8.0

To copy syntax-highlighted code in Yabb's forum format, right-click on the expression and select "Copy for Yabb forum".
You can also do CTRL+Click to generate the alternative un-quoted style as seen above.

Important caveat:
If the expression contains some HTML tags such as <B>, <U> and <I>, the pasted code will include some extra non-visible characters to prevent the forum from mangling it. This however results in an invalid expression when copied back into MC, so Zelda will add a warning in red. To fix it, manually delete and re-type the HTML tags after pasting into MC.

Likewise, there's an option to include comments (lines starting with ##, grey highlight). These comments are only valid in Zelda, so a warning will also be shown to remind the user to delete them in MC.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on March 14, 2024, 11:09:57 pm
Confirmed it now opens linked tabs for me without having to Ctrl-click.

Unfortunately, I'm now getting an unhandled exception error every time I try to close a tab. It doesn't seem to matter if it's linked or not. When I first ran this version after being prompted for the update, it opened up with a bunch of tabs re-opened that I had closed previously. When I tried re-closing them, I got the unhandled exception error, but I also get it when I try and close recently opened tabs as well.

I also was thinking that now that you're able to link directly to a field and edit it in place like this, is there a possibility of allowing the user to edit the Description field of the library field too?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 15, 2024, 02:29:47 am

Can you please paste the exception here? I can't reproduce it.

Quote
I also was thinking that now that you're able to link directly to a field and edit it in place like this, is there a possibility of allowing the user to edit the Description field of the library field too?

I thought about adding the creation/editing/deletion of Fields, but that would just be duplicating something that you can already do in MC. These are one-time things, I don't think it needs to be in Zelda. Do you have a specific usecase in mind?
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on March 26, 2024, 09:52:03 pm
No worries on the exception. I can't reproduce it now either. I do have the text from it from when I did get it, though. I attached it to this reply in case you're still curious.

As for the description field thing, I get what you're saying about not wanting to reproduce existing behavior, and I agree, that would be too much. My use case was that I was editing a field, which referenced another field that I couldn't remember what it did or what it's intention was, so I wanted to check it out. As I was browsing the list of my fields from Zelda's linked tab button, I realized how many I have and how hard it is to remember what each is for, and started wishing it would show the field's description in like a tooltip or something as I hover over them. Then I realized how few of my fields utilize the Description field (even though I requested that feature be added in the first place, embarrassingly enough), and then thought how nice it would be if I could edit the description right there from within Zelda as I was working on the expression itself. It's not crucial by any means, although the tooltip thing would be nice, or if it could alternatively display the description somewhere in the UI for the selected tab.

I also think we need to start petitioning the guys to add an "Edit in Zelda" right click option for fields in the tag window if it detects it's installed.  ;D

Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 27, 2024, 07:26:13 am
I added some defensive code to prevent the exception.
I wanted to add the field Descriptions as tooltips but unfortunately the MCWS API doesn't provide them, so that's a no go.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Matt on March 27, 2024, 08:33:28 am
I wanted to add the field Descriptions as tooltips but unfortunately the MCWS API doesn't provide them, so that's a no go.

Next build:
Changed: When a field has a description, it is returned in the Library/Fields call.

Thanks for the suggestion.
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: zybex on March 27, 2024, 09:17:12 am
Thanks Matt :)
Title: Re: ZELDA v1.0 released (Expression Language editor)
Post by: Doof on March 27, 2024, 12:14:30 pm
Cheers! Thanks Matt!