luminescence-software / scripts

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

Get Lyrics call from script #2

Closed aidanmischke closed 2 years ago

aidanmischke commented 7 years ago

Hi there,

Great software! How would I go about calling the Get Lyrics feature within a script?

Context I have a Title of: Feel So Close - Calvin Harris Which I will cut up to pass to the Lyrics search call. (Lyrics search is uses tags ARTIST and TITLE which have to be exact)

Thanks!

CyberSinh commented 7 years ago

It's already possible:

using Metatogger.Business;
using Metatogger.Data;

foreach (var file in files)
{
  string artist = file.GetFirstValue(TagName.Artist);
  string title = file.GetFirstValue(TagName.Title);
  if (artist != null && title != null)
  {
    string lyrics = await LyricsWikiaServices.GetSongAsync(artist, title);
    if (lyrics != null)
      file.SetTag(TagName.Lyrics, lyrics);   
  }
}
aidanmischke commented 7 years ago

Thanks!

As Wikia Lyrics couldn't find lyrics for certain songs is it possible to access a different lyrics service from a Metatogger script?

CyberSinh commented 7 years ago

Metatogger doesn't support natively another lyrics provider. But you can call any webservice on internet with C# script...

CyberSinh commented 2 years ago

Lyrics Wikia is not supported anymore in Metatogger.