[Pkg-cli-apps-commits] [SCM] banshee-community-extensions branch, ubuntu, updated. debian/1.9.0-1ubuntu1-3-g6d26f8b

Iain Lane laney at ubuntu.com
Wed Nov 24 14:59:41 UTC 2010


The following commit has been merged in the ubuntu branch:
commit 6d26f8bd7cefa1fae74ad5d3827bbe05bbe8d6db
Author: Iain Lane <laney at ubuntu.com>
Date:   Wed Nov 24 13:38:19 2010 +0000

    Fix build with new RandomBy APIs included in git snapshot
    
    Backport upstream commits a1dde5cm, a4ba3d4 and 03e1fa1 which enable
    use of new APIs.
    
    Also increase required banshee version to ensure these APIs are
    available.

diff --git a/debian/control b/debian/control
index 3ace518..a283f65 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 7.0.50),
                mono-devel (>= 2.4.2.3),
                autotools-dev,
                lsb-release,
-               banshee (>= 1.9.0),
+               banshee (>> 1.9.0+),
                pkg-config,
                liblircclient-dev (>= 0.8.6),
                libglib2.0-dev,
diff --git a/debian/patches/mirage-new-randomby-api.patch b/debian/patches/mirage-new-randomby-api.patch
new file mode 100644
index 0000000..6d497c9
--- /dev/null
+++ b/debian/patches/mirage-new-randomby-api.patch
@@ -0,0 +1,146 @@
+Index: banshee-community-extensions.git/src/Mirage/Banshee.Mirage/BaseSimilarityContext.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/Mirage/Banshee.Mirage/BaseSimilarityContext.cs	2010-11-24 13:37:30.180132132 +0000
++++ banshee-community-extensions.git/src/Mirage/Banshee.Mirage/BaseSimilarityContext.cs	2010-11-24 13:58:34.297466784 +0000
+@@ -6,7 +6,7 @@
+ 
+ namespace Banshee.Mirage
+ {
+-    public abstract class BaseSimilarityContext : IDisposable
++    public abstract class BaseSimilarityContext : Banshee.Collection.Database.RandomBy.QueryContext
+     {
+         private int seed_id;
+         protected ScmsConfiguration Config = new ScmsConfiguration (Analyzer.MFCC_COEFFICIENTS);
+@@ -32,15 +32,22 @@
+ 
+         public abstract IEnumerable<float> Distance (Scms from);
+ 
+-        public void Dispose ()
++        public override void Dispose ()
+         {
+             DistanceCalculator.RemoveSeed (seed_id);
+ 
+             if (MiragePlugin.Debug) {
+-                Console.WriteLine (">>>>>>>>>>>>>> Total ms spent in Distance func: {0} ms - spent reading: {1} ms; total calls: {2}",
+-                                   DistanceCalculator.total_ms, DistanceCalculator.total_read_ms, DistanceCalculator.total_count);
+-                Console.WriteLine (">>>>>>>>>>>>>> Distance [min, max] = [{0}, {1}]", min_distance, max_distance);
++                DumpDebug ();
+             }
++
++            base.Dispose ();
++        }
++
++        protected virtual void DumpDebug ()
++        {
++            Console.WriteLine (">>>>>>>>>>>>>> Total ms spent in Distance func: {0} ms - spent reading: {1} ms; total calls: {2}",
++                               DistanceCalculator.total_ms, DistanceCalculator.total_read_ms, DistanceCalculator.total_count);
++            Console.WriteLine (">>>>>>>>>>>>>> Distance [min, max] = [{0}, {1}]", min_distance, max_distance);
+         }
+     }
+-}
+\ No newline at end of file
++}
+Index: banshee-community-extensions.git/src/Mirage/Banshee.Mirage/RandomBySimilar.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/Mirage/Banshee.Mirage/RandomBySimilar.cs	2010-11-24 13:37:30.200133662 +0000
++++ banshee-community-extensions.git/src/Mirage/Banshee.Mirage/RandomBySimilar.cs	2010-11-24 13:59:30.601808268 +0000
+@@ -47,8 +47,6 @@
+         // The RANDOM_CONDITION will exclude the played/skipped items for us, but we need to
+         // add the Similarity-based selection[, exclusion], and ordering.
+ 
+-        private string cache_condition;
+-
+         public RandomBySimilar () : base ("mirage_similar")
+         {
+             MiragePlugin.Init ();
+@@ -58,9 +56,9 @@
+             Description = AddinManager.CurrentLocalizer.GetString ("Play songs similar to those already played");
+ 
+             // TODO Mirage's PlaylistGeneratorSource ensures no more than 50% of tracks are by same artist
+-            Condition = "mirage.Status = 0 AND CoreTracks.ArtistID NOT IN (?) AND Distance > 0";
+-            From = "LEFT OUTER JOIN MirageTrackAnalysis mirage ON (mirage.TrackID = CoreTracks.TrackID) ";
+             Select = ", HYENA_BINARY_FUNCTION ('MIRAGE_DISTANCE', ?, mirage.ScmsData) as Distance";
++            From = "LEFT OUTER JOIN MirageTrackAnalysis mirage ON (mirage.TrackID = CoreTracks.TrackID) ";
++            Condition = "mirage.Status = 0 AND CoreTracks.ArtistID NOT IN (?) AND Distance > 0";
+             OrderBy = "Distance ASC, RANDOM ()";
+ 
+             cache_condition = String.Format ("AND {0} {1} ORDER BY {2}", Condition, RANDOM_CONDITION, OrderBy);
+@@ -71,29 +69,9 @@
+             return true;
+         }
+ 
+-        public override TrackInfo GetPlaybackTrack (DateTime after)
+-        {
+-            return GetTrack (after, true);
+-        }
+-
+-        public override DatabaseTrackInfo GetShufflerTrack (DateTime after)
+-        {
+-            return GetTrack (after, false);
+-        }
+-
+-        private DatabaseTrackInfo GetTrack (DateTime after, bool playback)
++        protected override RandomBy.QueryContext GetQueryContext (DateTime after)
+         {
+-            using (var context = GetSimilarityContext (after, playback)) {
+-                var track = playback
+-                    ? Cache.GetSingle (Select, From, cache_condition, context.Id, context.AvoidArtistIds, after, after) as DatabaseTrackInfo
+-                    : GetTrack (ShufflerQuery, context.Id, context.AvoidArtistIds, after) as DatabaseTrackInfo;
+-
+-                if (MiragePlugin.Debug) {
+-                    Console.WriteLine ("Mirage got {0} as lowest avg distance to the similarity context", track == null ? "(null)" : track.Uri.ToString ());
+-                    context.DumpDebug ();
+-                }
+-                return track;
+-            }
++            return GetSimilarityContext (after, Shuffler == Shuffler.Playback);
+         }
+ 
+         private SimilarityContext GetSimilarityContext (DateTime after, bool playback)
+@@ -101,14 +79,14 @@
+             var context = new SimilarityContext ();
+ 
+             if (!playback) {
+-                // Manually added songs are the strongest postiive signal for what we want
++                // Manually added songs are the strongest postive signal for what we want
+                 context.AddSeeds (GetSeeds (
+                     "d.ModificationType = 1 AND d.LastModifiedAt IS NOT NULL AND d.LastModifiedAt > ? ORDER BY d.LastModifiedAt DESC",
+                     after, 4, SimilarityContext.SelectedWeight
+                 ));
+             }
+ 
+-            // Played songs are the next strongest postiive signal for what we want
++            // Played songs are the next strongest postive signal for what we want
+             context.AddSeeds (GetSeeds (
+                 "t.LastPlayedStamp IS NOT NULL AND t.LastPlayedStamp > MAX (?, coalesce(d.LastModifiedAt, 0), coalesce(t.LastSkippedStamp, 0)) ORDER BY t.LastPlayedStamp DESC",
+                 after, playback ? 4 : 2, SimilarityContext.PlayedWeight
+Index: banshee-community-extensions.git/src/Mirage/Banshee.Mirage/SimilarityContext.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/Mirage/Banshee.Mirage/SimilarityContext.cs	2010-11-24 13:37:30.170131364 +0000
++++ banshee-community-extensions.git/src/Mirage/Banshee.Mirage/SimilarityContext.cs	2010-11-24 13:58:34.297466784 +0000
+@@ -52,7 +52,15 @@
+             }
+         }
+ 
+-        public void DumpDebug ()
++        public override IEnumerable<object> Parameters {
++            get {
++                yield return Id;
++                yield return AvoidArtistIds;
++            }
++            set {}
++        }
++
++        protected override void DumpDebug ()
+         {
+             var avoid_ids = String.Join (", ", AvoidArtistIds.Select (id => id.ToString ()).ToArray ());
+             Console.WriteLine ("  Avoided artist ids = {0}\n  Seed Distances:", avoid_ids);
+@@ -60,6 +68,8 @@
+             debug = true;
+             Console.WriteLine ("  Average weighted distance: {0:N1}", Distance (best_scms).Average ());
+             debug = false;
++
++            base.DumpDebug ();
+         }
+ 
+         public override IEnumerable<float> Distance (Scms from)
diff --git a/debian/patches/randombylastfm-new-randomby-api.patch b/debian/patches/randombylastfm-new-randomby-api.patch
new file mode 100644
index 0000000..08e2f86
--- /dev/null
+++ b/debian/patches/randombylastfm-new-randomby-api.patch
@@ -0,0 +1,89 @@
+Index: banshee-community-extensions.git/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmSimilarArtists.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmSimilarArtists.cs	2010-11-24 13:58:35.597567037 +0000
++++ banshee-community-extensions.git/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmSimilarArtists.cs	2010-11-24 14:41:14.624864728 +0000
+@@ -49,8 +49,6 @@
+         private const int MAX_ARTISTS = 200;
+         private const string ARTIST_QUERY = @"SELECT ArtistID, NameLowered FROM CoreArtists GROUP BY NameLowered HAVING NameLowered in (?)";
+ 
+-        private static string track_condition = String.Format ("AND CoreArtists.ArtistID = ? {0} ORDER BY RANDOM()", RANDOM_CONDITION);
+-
+         private static bool initiated = false;
+         private static object initiated_lock = new object ();
+         private static short instanceCount = 0;
+@@ -102,10 +100,9 @@
+             });
+         }
+ 
+-        public override TrackInfo GetPlaybackTrack (DateTime after)
++        protected override IEnumerable<object> GetConditionParameters (DateTime after)
+         {
+-            int randomId = weightedRandom.GetRandom ();
+-            return Cache.GetSingleWhere (track_condition, randomId, after, after);
++			yield return weightedRandom.GetRandom ();
+         }
+ 
+         public override bool Next (DateTime after)
+@@ -113,12 +110,6 @@
+             return true;
+         }
+ 
+-        public override DatabaseTrackInfo GetShufflerTrack (DateTime after)
+-        {
+-            int randomId = weightedRandom.GetRandom ();
+-            return GetTrack (ShufflerQuery, randomId, after);
+-        }
+-
+         /// <summary>
+         /// Catch PlayerEvent and schedule new lastfm query, as long as current Artist is not the last artist queried
+         /// </summary>
+Index: banshee-community-extensions.git/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmUserTopArtists.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmUserTopArtists.cs	2010-11-24 13:58:35.577565496 +0000
++++ banshee-community-extensions.git/src/RandomByLastfm/Banshee.RandomByLastfm/RandomByLastfmUserTopArtists.cs	2010-11-24 14:41:14.624864728 +0000
+@@ -49,8 +49,6 @@
+ 
+         private const string ARTIST_QUERY = @"SELECT ArtistID, NameLowered FROM CoreArtists GROUP BY NameLowered HAVING NameLowered in (?) OR MusicBrainzID in (?)";
+ 
+-        private static string track_condition = String.Format ("AND CoreArtists.ArtistID = ? {0} ORDER BY RANDOM()", RANDOM_CONDITION);
+-
+         private static bool initiated = false;
+         private static object initiated_lock = new object ();
+         private static short instanceCount = 0;
+@@ -105,9 +103,9 @@
+             });
+         }
+ 
+-        public override TrackInfo GetPlaybackTrack (DateTime after)
++        protected override IEnumerable<object> GetConditionParameters (DateTime after)
+         {
+-            return Cache.GetSingleWhere (track_condition, weightedRandom.GetInvertedRandom (), after, after);
++			yield return weightedRandom.GetInvertedRandom ();
+         }
+ 
+         public override bool Next (DateTime after)
+@@ -115,12 +113,6 @@
+             return true;
+         }
+ 
+-        public override DatabaseTrackInfo GetShufflerTrack (DateTime after)
+-        {
+-            return GetTrack (ShufflerQuery, weightedRandom.GetInvertedRandom (), after);
+-        }
+-
+-
+         /// <summary>
+         /// Query Lastfm for UserTopArtists
+         /// </summary>
+Index: banshee-community-extensions.git/src/Mirage/Banshee.Mirage/RandomBySimilar.cs
+===================================================================
+--- banshee-community-extensions.git.orig/src/Mirage/Banshee.Mirage/RandomBySimilar.cs	2010-11-24 14:41:27.685872433 +0000
++++ banshee-community-extensions.git/src/Mirage/Banshee.Mirage/RandomBySimilar.cs	2010-11-24 14:41:51.477708056 +0000
+@@ -61,7 +61,6 @@
+             Condition = "mirage.Status = 0 AND CoreTracks.ArtistID NOT IN (?) AND Distance > 0";
+             OrderBy = "Distance ASC, RANDOM ()";
+ 
+-            cache_condition = String.Format ("AND {0} {1} ORDER BY {2}", Condition, RANDOM_CONDITION, OrderBy);
+         }
+ 
+         public override bool Next (DateTime after)
diff --git a/debian/patches/series b/debian/patches/series
index 68c8a97..a44dacb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ enable-u1ms.patch
 fix-ampache-unicode.patch
 0001-Ampache-Fix-compilation-with-banshee-1.9.0.patch
 fsck-intltool.patch
+mirage-new-randomby-api.patch
+randombylastfm-new-randomby-api.patch

-- 
banshee-community-extensions



More information about the Pkg-cli-apps-commits mailing list