luminescence-software / scripts

C# scripts for Metatogger
Mozilla Public License 2.0
8 stars 7 forks source link

Metatogger crash on execution of custom c# script #10

Closed Saenil closed 5 years ago

Saenil commented 5 years ago

Hi, I have a custom script for retrieving track number from the filename, it looks like this:

using System.Linq;
using Metatogger.Data;
using Metatogger.Business;

foreach (var file in files) {
  var tags = TagProcessor.TagFromFilename("|tracknumber| - |artist| - |title|", file);
  if (tags.ContainsKey(TagName.TrackNumber)) {
    file.SetTag(TagName.TrackNumber, tags[TagName.TrackNumber][0]);
  }
}

after updating to version 6.0.2.2 (a few minutes ago) it stopped working, instead of that the whole app is crushing with this message:

Metatogger 6.0.2.2 System.InvalidOperationException: A cross-thread operation is detected. For more information, refer to https://documentation.devexpress.com/WPF/11765/Controls-and-Libraries/Data-Grid/Binding-to-Data/Managing-Multi-Thread-Data-Updates at DevExpress.Xpf.Editors.Helpers.DataController.ThrowCrossThreadException() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

before an update, everything was working just fine.

Can you help me with this? Maybe you know what could be the cause of this problem?

Btw.: The app is awesome ;)

CyberSinh commented 5 years ago

Hi, Sorry for this issue, related to bad multithreading synchronization. I have just released a new version (6.0.2.3) that should fix the problem. Please update and tell if everything works as expected. Thanks,

Saenil commented 5 years ago

Now it works like a charm, thank you ;)