Gentoo Archives: gentoo-commits

From: "Peter Alfredsen (loki_val)" <loki_val@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/banshee/files: banshee-1.4.2-metadata-writefail.patch
Date: Wed, 28 Jan 2009 19:14:15
Message-Id: E1LSFrY-0005F9-Su@stork.gentoo.org
1 loki_val 09/01/28 19:14:12
2
3 Added: banshee-1.4.2-metadata-writefail.patch
4 Log:
5 Bump, fixing 256157. Drop gnome2.eclass usage, I once again got bit by bug 239123 while remaking the ebuild, take up again when gnome2.eclass isn't broken. Code duplication sucks. Fix bug 249620, included musicbrainz was getting old and buggy. Update to a newer revision. Thanks to Tom Corner <tacorner@××××××××××××.org> for the patch. Refresh metadata-fail patch to apply against 1.4.2.
6 (Portage version: 2.2_rc23/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 media-sound/banshee/files/banshee-1.4.2-metadata-writefail.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/banshee/files/banshee-1.4.2-metadata-writefail.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/banshee/files/banshee-1.4.2-metadata-writefail.patch?rev=1.1&content-type=text/plain
13
14 Index: banshee-1.4.2-metadata-writefail.patch
15 ===================================================================
16 diff -NrU5 banshee-1-1.4.2.orig/src/Core/Banshee.Core/Banshee.Streaming/SaveTrackMetadataJob.cs banshee-1-1.4.2/src/Core/Banshee.Core/Banshee.Streaming/SaveTrackMetadataJob.cs
17 --- banshee-1-1.4.2.orig/src/Core/Banshee.Core/Banshee.Streaming/SaveTrackMetadataJob.cs 2008-10-06 18:27:31.000000000 +0200
18 +++ banshee-1-1.4.2/src/Core/Banshee.Core/Banshee.Streaming/SaveTrackMetadataJob.cs 2009-01-28 16:56:18.000000000 +0100
19 @@ -27,10 +27,11 @@
20 //
21
22 using System;
23 using Mono.Unix;
24
25 +using Banshee.Base;
26 using Banshee.Collection;
27 using Banshee.Configuration.Schema;
28
29 namespace Banshee.Streaming
30 {
31 @@ -84,26 +85,28 @@
32 file.Tag.Comment = track.Comment;
33 file.Tag.Disc = (uint)track.DiscNumber;
34 file.Tag.DiscCount = (uint)track.DiscCount;
35 file.Tag.Year = (uint)track.Year;
36 file.Tag.BeatsPerMinute = (uint)track.Bpm;
37 -
38 - SaveIsCompilation (file.Tag, track.IsCompilation);
39 +
40 + SaveIsCompilation (file, track.IsCompilation);
41 file.Save ();
42 }
43
44 - private static void SaveIsCompilation (TagLib.Tag tag, bool is_compilation)
45 + private static void SaveIsCompilation (TagLib.File file, bool is_compilation)
46 {
47 - TagLib.Id3v2.Tag id3v2_tag = tag as TagLib.Id3v2.Tag;
48 - if (id3v2_tag != null) {
49 - id3v2_tag.IsCompilation = is_compilation;
50 - return;
51 - }
52 + try {
53 + TagLib.Id3v2.Tag id3v2_tag = file.GetTag(TagLib.TagTypes.Id3v2, true) as TagLib.Id3v2.Tag;
54 + if (id3v2_tag != null) {
55 + id3v2_tag.IsCompilation = is_compilation;
56 + }
57 + } catch {}
58
59 - TagLib.Mpeg4.AppleTag apple_tag = tag as TagLib.Mpeg4.AppleTag;
60 - if (apple_tag != null) {
61 - apple_tag.IsCompilation = is_compilation;
62 - return;
63 - }
64 + try {
65 + TagLib.Mpeg4.AppleTag apple_tag = file.GetTag(TagLib.TagTypes.Apple,true) as TagLib.Mpeg4.AppleTag;
66 + if (apple_tag != null) {
67 + apple_tag.IsCompilation = is_compilation;
68 + }
69 + } catch {}
70 }
71 }
72 }
73 diff -NrU5 banshee-1-1.4.2.orig/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs banshee-1-1.4.2/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
74 --- banshee-1-1.4.2.orig/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs 2009-01-09 00:17:58.000000000 +0100
75 +++ banshee-1-1.4.2/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs 2009-01-28 16:57:49.000000000 +0100
76 @@ -139,11 +139,11 @@
77 FindTrackMediaAttributes (track, file);
78
79 track.ArtistName = Choose (file.Tag.JoinedPerformers, track.ArtistName, preferTrackInfo);
80 track.AlbumTitle = Choose (file.Tag.Album, track.AlbumTitle, preferTrackInfo);
81 track.AlbumArtist = Choose (file.Tag.FirstAlbumArtist, track.AlbumArtist, preferTrackInfo);
82 - track.IsCompilation = IsCompilation (file.Tag);
83 + track.IsCompilation = IsCompilation (file);
84
85 track.TrackTitle = Choose (file.Tag.Title, track.TrackTitle, preferTrackInfo);
86 track.Genre = Choose (file.Tag.FirstGenre, track.Genre, preferTrackInfo);
87 track.Composer = Choose (file.Tag.FirstComposer, track.Composer, preferTrackInfo);
88 track.Conductor = Choose (file.Tag.Conductor, track.Conductor, preferTrackInfo);
89 @@ -180,25 +180,29 @@
90 // TODO look for track number in the file name if not set?
91 // TODO could also pull artist/album from folders _iff_ files two levels deep in the MusicLibrary folder
92 // TODO these ideas could also be done in an extension that collects such hacks
93 }
94
95 - private static bool IsCompilation (TagLib.Tag tag)
96 + private static bool IsCompilation (TagLib.File file)
97 {
98 - TagLib.Id3v2.Tag id3v2_tag = tag as TagLib.Id3v2.Tag;
99 - if (id3v2_tag != null && id3v2_tag.IsCompilation)
100 - return true;
101 -
102 - TagLib.Mpeg4.AppleTag apple_tag = tag as TagLib.Mpeg4.AppleTag;
103 - if (apple_tag != null && apple_tag.IsCompilation)
104 - return true;
105 + try {
106 + TagLib.Id3v2.Tag id3v2_tag = file.GetTag(TagLib.TagTypes.Id3v2, true) as TagLib.Id3v2.Tag;
107 + if (id3v2_tag != null && id3v2_tag.IsCompilation)
108 + return true;
109 + } catch {}
110
111 + try {
112 + TagLib.Mpeg4.AppleTag apple_tag = file.GetTag(TagLib.TagTypes.Apple,true) as TagLib.Mpeg4.AppleTag;
113 + if (apple_tag != null && apple_tag.IsCompilation)
114 + return true;
115 + } catch {}
116 +
117 // FIXME the FirstAlbumArtist != FirstPerformer check might return true for half the
118 // tracks on a compilation album, but false for some
119 // TODO checked for 'Soundtrack' (and translated) in the title?
120 - if (tag.Performers.Length > 0 && tag.AlbumArtists.Length > 0 &&
121 - (tag.Performers.Length != tag.AlbumArtists.Length || tag.FirstAlbumArtist != tag.FirstPerformer)) {
122 + if (file.Tag.Performers.Length > 0 && file.Tag.AlbumArtists.Length > 0 &&
123 + (file.Tag.Performers.Length != file.Tag.AlbumArtists.Length || file.Tag.FirstAlbumArtist != file.Tag.FirstPerformer)) {
124 return true;
125 }
126 return false;
127 }