コード例 #1
0
        public TrackInfo GetTrack(DateTime after)
        {
            if (!IsReady)
            {
                return(null);
            }

            TrackInfo track = null;

            using (var context = GetQueryContext(after)) {
                var args = context.Parameters.ToList();
                args.Add(after);

                if (Shuffler == Shuffler.Playback)
                {
                    // Add a second after arg b/c we query against lastplay/lastskip stamps
                    args.Add(after);
                    track = Cache.GetSingle(Select, From, CacheCondition, args.ToArray());
                }
                else
                {
                    track = GetTrack(ShufflerQuery, args.ToArray());
                }
            }

            Shuffler.RecordShuffle(track as DatabaseTrackInfo);
            return(track);
        }