public static PlaylistInfo TracksAndIndex() { return(MusicDataContext.WithConnection <PlaylistInfo>(db => { var tracks = Tracks(db); return new PlaylistInfo(tracks, Index(db)); })); }
public static ObservableCollection <PlayFrequency> MostPlayed(int count = 100) { return(MusicDataContext.WithConnection(db => { var mostPlayed = (from PlayFrequency playFreq in db.PlayFrequencies orderby playFreq.PlayCount descending select playFreq).Take(count); return new ObservableCollection <PlayFrequency>(mostPlayed); })); }
public override Task <List <string> > LeastPlayed(int count = 20) { return(TaskEx.Run(() => { return MusicDataContext.WithConnection(db => { var leastPlayed = (from PlayFrequency playFreq in db.PlayFrequencies orderby playFreq.PlayCount ascending select playFreq.SongPath).Take(count); return new List <string>(leastPlayed); }); })); }
public static int Index() { return(MusicDataContext.WithConnection <int>(db => { return Index(db); })); }
public static List <PlaylistTrack> Tracks() { return(MusicDataContext.WithConnection <List <PlaylistTrack> >(db => { return Tracks(db); })); }