home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Submit: Bug Reports
[MP2-813] Album artist filter wrong display
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="hwahrmann" data-source="post: 1264344" data-attributes="member: 10391"><p>Sorry about that. The MusicBrainz... properties do indeed only show specific properties from MB.</p><p>In order to get the ARtists, you need to get the id3v2tag and then loop through the TXXX frames looking for the "ARTISTS" description.</p><p>Something like this:</p><p></p><p>[code=csharp]using System;</p><p>using TagLib;</p><p>using TagLib.Id3v2;</p><p></p><p>namespace TaglibTest</p><p>{</p><p> class Program</p><p> {</p><p> static void Main(string[] args)</p><p> {</p><p> try</p><p> {</p><p> TagLib.ByteVector.UseBrokenLatin1Behavior = true;</p><p> File file = File.Create(@"d:\Downloads\Music\01 - Come Home (Feat. André 3000).mp3");</p><p></p><p> // Get the Id3v2tag, if the fileis mp3</p><p> TagLib.Id3v2.Tag id3v2tag = null;</p><p> try</p><p> {</p><p> if (file.MimeType.Substring(file.MimeType.IndexOf("/") + 1) == "mp3")</p><p> {</p><p> id3v2tag = file.GetTag(TagTypes.Id3v2, false) as TagLib.Id3v2.Tag;</p><p> }</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Console.WriteLine("File Read: Error retrieving id3tag");</p><p> return;</p><p> }</p><p></p><p> if (id3v2tag != null)</p><p> {</p><p> foreach (TagLib.Id3v2.Frame frame in id3v2tag.GetFrames())</p><p> {</p><p> var frameId = frame.FrameId.ToString();</p><p> if (frameId == "TXXX" && (frame as UserTextInformationFrame).Description.ToLowerInvariant() == "artists")</p><p> {</p><p> // we could have multiple of them</p><p> foreach (var field in (frame as UserTextInformationFrame).Text)</p><p> {</p><p> Console.WriteLine($"MusicBrainzArtist: {field}");</p><p> }</p><p> }</p><p> }</p><p> }</p><p> Console.ReadLine();</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Console.WriteLine(ex.Message);</p><p> Console.WriteLine(ex.StackTrace);</p><p> Console.ReadLine();</p><p> }</p><p> }</p><p> }</p><p>}[/code]</p></blockquote><p></p>
[QUOTE="hwahrmann, post: 1264344, member: 10391"] Sorry about that. The MusicBrainz... properties do indeed only show specific properties from MB. In order to get the ARtists, you need to get the id3v2tag and then loop through the TXXX frames looking for the "ARTISTS" description. Something like this: [code=csharp]using System; using TagLib; using TagLib.Id3v2; namespace TaglibTest { class Program { static void Main(string[] args) { try { TagLib.ByteVector.UseBrokenLatin1Behavior = true; File file = File.Create(@"d:\Downloads\Music\01 - Come Home (Feat. André 3000).mp3"); // Get the Id3v2tag, if the fileis mp3 TagLib.Id3v2.Tag id3v2tag = null; try { if (file.MimeType.Substring(file.MimeType.IndexOf("/") + 1) == "mp3") { id3v2tag = file.GetTag(TagTypes.Id3v2, false) as TagLib.Id3v2.Tag; } } catch (Exception ex) { Console.WriteLine("File Read: Error retrieving id3tag"); return; } if (id3v2tag != null) { foreach (TagLib.Id3v2.Frame frame in id3v2tag.GetFrames()) { var frameId = frame.FrameId.ToString(); if (frameId == "TXXX" && (frame as UserTextInformationFrame).Description.ToLowerInvariant() == "artists") { // we could have multiple of them foreach (var field in (frame as UserTextInformationFrame).Text) { Console.WriteLine($"MusicBrainzArtist: {field}"); } } } } Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); Console.ReadLine(); } } } }[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Submit: Bug Reports
[MP2-813] Album artist filter wrong display
Contact us
RSS
Top
Bottom