~chipaca/unity-lens-music/dont-force-us

« back to all changes in this revision

Viewing changes to src/banshee-collection.vala

  • Committer: Neil Jagdish Patel
  • Author(s): Alex Launi
  • Date: 2011-09-15 18:08:53 UTC
  • mfrom: (41.1.5 musicstore)
  • Revision ID: neil.patel@canonical.com-20110915180853-hc7natia0x01nwap
Merge in initial support for searching one.ubuntu.com for music to purchase

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
            artwork_path = "audio-x-generic";
108
108
 
109
109
          Track track = new Track ();
110
 
          track.Title = stmt.column_text (TRACK_TITLE);
111
 
          track.Artist = stmt.column_text (ARTIST_NAME);
112
 
          track.Uri = stmt.column_text (TRACK_URI);
113
 
          track.MimeType = stmt.column_text (TRACK_MIMETYPE);          
 
110
          track.title = stmt.column_text (TRACK_TITLE);
 
111
          track.artist = stmt.column_text (ARTIST_NAME);
 
112
          track.uri = stmt.column_text (TRACK_URI);
 
113
          track.mime_type = stmt.column_text (TRACK_MIMETYPE);          
 
114
          track.artwork_path = artwork_path;
114
115
          
115
116
          Album album = new Album ();
116
 
          album.Title = stmt.column_text (ALBUM_TITLE);
117
 
          album.Artist = stmt.column_text (ARTIST_NAME);
118
 
          
119
 
          results_model.append (track.Uri, artwork_path, 0, track.MimeType, track.Title, track.Artist);
120
 
          
121
 
          if (albums.add (album.Artist + album.Title)) {
122
 
            results_model.append ("album://%s/%s".printf (album.Artist, album.Title), artwork_path, 1, 
123
 
                                  "audio-x-generic", album.Title, album.Artist);
 
117
          album.title = stmt.column_text (ALBUM_TITLE);
 
118
          album.artist = stmt.column_text (ARTIST_NAME);
 
119
          album.uri = "album://%s/%s".printf (album.artist, album.title);
 
120
          album.artwork_path = artwork_path;
 
121
          
 
122
          results_model.append (track.uri, track.artwork_path, 0, track.mime_type, track.title, track.artist, track.uri);
 
123
          
 
124
          if (albums.add (album.artist + album.title)) {
 
125
            // FIXME drag n drop uri should be the path to the album dir?
 
126
            results_model.append (album.uri, album.artwork_path, 1, "audio-x-generic", album.title, album.artist, null);
124
127
          }
125
128
          
126
129
          break;
148
151
                          AND CoreAlbums.Title IS '%s'
149
152
                          AND CoreArtists.Name IS '%s'
150
153
                          AND CoreTracks.URI IS NOT NULL
151
 
                    ORDER BY CoreTracks.TrackNumber ASC".printf (album.Title, album.Artist);
 
154
                    ORDER BY CoreTracks.TrackNumber ASC".printf (album.title, album.artist);
152
155
 
153
156
      rc = execute_sql (sql, out stmt);
154
157
      
184
187
      
185
188
      foreach (FilterParser parser in filters)
186
189
      {
187
 
        string parsed = parser.parse ();
 
190
        BansheeFilterParser bparser;
 
191
        debug ("parsing for %s", parser.id);
 
192
        if (parser is GenreFilterParser)
 
193
          bparser = new BansheeGenreFilterParser (parser as GenreFilterParser);
 
194
        else if (parser is DecadeFilterParser)
 
195
          bparser = new BansheeDecadeFilterParser (parser as DecadeFilterParser);
 
196
        else
 
197
          {
 
198
            warning ("Recieved an unimplemented filter type");
 
199
            continue;       
 
200
          }
 
201
 
 
202
        string parsed = bparser.parse ();
 
203
        debug (parsed);
188
204
 
189
205
        if (parsed == null || parsed == "")
190
206
          continue;