Example #1
0
        /// <summary>
        /// Finds the full url for the (probably partially specified url)
        /// for the media file url, using the media path and
        /// user input if necessary.
        /// </summary>
        /// <param name="track"></param>
        /// <returns></returns>
        public string Find(Track track)
        {
            List <string> places = new List <string> {
                MediaPath
            };
            string path = TrackFinder.Find(track.Url, places);

            //before returning the path, check if found, otherwise request user input, if not found successfully
            if (!File.Exists(path))
            {
                //request user input
                path = OnFileMissing(track.Name);

                if (!File.Exists(path)) //still not found?
                {
                    throw new FileNotFoundException(String.Format("Media file for track {0} not found", track.Name));
                }
            }

            //we now have the best guess about where that media file is, so save it here
            if (!track.Url.Equals(path)) //we have now found a location that is different to what we first knew?
            {
                //use this one from now on with this track.
                track.Url = path;
            }
            return(path);
        }
Example #2
0
        /// <summary>
        ///     Finds the full url for the (probably partially specified url)
        ///     for the media file url, using the media path.
        /// </summary>
        /// <param name="track"></param>
        /// <returns></returns>
        public override String Find(Track track)
        {
            List <string> places = new List <string> {
                MediaPath, Url
            };                                                         //first use the specified media path, but as backup also the place where the compliation is stored
            string path = TrackFinder.Find(track.Url, places);

            //we now have the best guess about where that media file is, so save it here
            if (!track.Url.Equals(path)) //we have now found a location that is different to what we first knew?
            {
                //use this one from now on with this track.
                track.Url = path;
            }
            return(path);
        }
Example #3
0
        /// <summary>
        ///     Finds the full url for the (probably partially specified url)
        ///     for the media file url, using the media path.
        /// </summary>
        /// <param name="track"></param>
        /// <returns></returns>
        public override String Find(Track track)
        {
            var places = new List <string> {
                MediaPath
            };
            string path = TrackFinder.Find(track.Url, places);

            //we now have the best guess about where that media file is, so save it here
            if (!track.Url.Equals(path)) //we have now found a location that is different to what we first knew?
            {
                //use this one from now on with this track.
                track.Url = path;
            }
            return(path);
        }
Example #4
0
        public override String Find(Track track)
        {
            var places = new List <string> {
                MediaPath
            };
            string path = TrackFinder.Find(track.Url, places);

            //before returning the path, check if found, otherwise request user input, if not found successfully
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Media file not found");
            }

            //we now have the best guess about where that media file is, so save that path here
            if (!track.Url.Equals(path)) //we have now found a location that is different to what we first knew?
            {
                //use this one from now on with this track.
                track.Url = path;
            }
            return(path);
        }