~ubuntu-branches/ubuntu/raring/banshee/raring

« back to all changes in this revision

Viewing changes to src/Extensions/Banshee.Podcasting/Banshee.Podcasting/PodcastService.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-01-23 23:16:49 UTC
  • mfrom: (6.3.22 experimental)
  • Revision ID: package-import@ubuntu.com-20120123231649-safm1f8eycltcgsf
Tags: 2.3.4.ds-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Enable and suggest u1ms
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector
  + [08dea2c] Revert "Fix invalid cast causing ftbfs with libgpod"
* [b617fe0] Convert Ubuntu-specific patches to gbp-pq patches
* Also fixes Launchpad bugs:
  - Fixes race condition while starting (LP: #766303)

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
                    ");
130
130
 
131
131
                    // Finally, move podcast items from the Music Library to the Podcast source
132
 
                    int [] primary_source_ids = new int [] { ServiceManager.SourceManager.MusicLibrary.DbId };
133
132
                    int moved = 0;
134
133
                    foreach (FeedEnclosure enclosure in FeedEnclosure.Provider.FetchAllMatching ("LocalPath IS NOT NULL AND LocalPath != ''")) {
135
134
                        SafeUri uri = new SafeUri (enclosure.LocalPath);
136
 
                        int track_id = DatabaseTrackInfo.GetTrackIdForUri (uri, primary_source_ids);
 
135
                        int track_id = DatabaseTrackInfo.GetTrackIdForUri (uri, ServiceManager.SourceManager.MusicLibrary.DbId);
137
136
 
138
137
                        if (track_id > 0) {
139
138
                            PodcastTrackInfo pi = new PodcastTrackInfo (DatabaseTrackInfo.Provider.FetchSingle (track_id));
264
263
                            ServiceManager.DbConnection.Execute (String.Format (
265
264
                                "UPDATE {0} SET LocalPath = REPLACE(LocalPath, ?, ?) WHERE LocalPath IS NOT NULL",
266
265
                                FeedEnclosure.Provider.TableName), old_path, new_path);
267
 
                            ServiceManager.DbConnection.Execute (
268
 
                                "UPDATE CoreTracks SET Uri = REPLACE(Uri, ?, ?) WHERE Uri LIKE 'file://%' AND PrimarySourceId = ?",
 
266
                            ServiceManager.DbConnection.Execute (String.Format (
 
267
                                    "UPDATE CoreTracks SET Uri = REPLACE ({0}, ?, ?)" +
 
268
                                    "WHERE {0} LIKE 'file://%' AND PrimarySourceId = ?",
 
269
                                    Banshee.Query.BansheeQuery.UriField.Column),
269
270
                                old_uri.AbsoluteUri, new_uri.AbsoluteUri, source.DbId);
270
271
                            Hyena.Log.DebugFormat ("Moved Podcasts from {0} to {1}", old_path, new_path);
271
272
                        }