private VideoUrlParseResult(VideoUrlParseResultType resultType, string url, VideoParseException exception) {

			ResultType = resultType;
			Url = url;
			Exception = exception ?? GetException(resultType, url);

		}
Example #2
0
        public static VideoParseException GetException(VideoUrlParseResultType resultType, string url)
        {
            switch (resultType)
            {
            case VideoUrlParseResultType.NoMatcher:
                return(new VideoParseException(string.Format("No matcher defined (url {0})", url)));

            case VideoUrlParseResultType.LoadError:
                return(new VideoParseException(string.Format("Unable to load metadata (url {0})", url)));

            case VideoUrlParseResultType.Duplicate:
                return(new VideoParseException(string.Format("Duplicate entry (url {0})", url)));

            case VideoUrlParseResultType.OtherError:
                return(new VideoParseException(string.Format("Unable to process PV link (url {0})", url)));

            default:
                return(null);
            }
        }
		public static VideoParseException GetException(VideoUrlParseResultType resultType, string url) {

			switch (resultType) {
				case VideoUrlParseResultType.NoMatcher:
					return new VideoParseException(string.Format("No matcher defined (url {0})", url));

				case VideoUrlParseResultType.LoadError:
					return new VideoParseException(string.Format("Unable to load metadata (url {0})", url));

				case VideoUrlParseResultType.Duplicate:
					return new VideoParseException(string.Format("Duplicate entry (url {0})", url));

				case VideoUrlParseResultType.OtherError:
					return new VideoParseException(string.Format("Unable to process PV link (url {0})", url));

				default:
					return null;
			}

		}
Example #4
0
 public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, string message)
 {
     return(CreateError(url, resultType, new VideoParseException(message)));
 }
Example #5
0
 public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, VideoParseException exception = null)
 {
     return(new VideoUrlParseResult(resultType, url, exception));
 }
Example #6
0
 private VideoUrlParseResult(VideoUrlParseResultType resultType, string url, VideoParseException exception)
 {
     ResultType = resultType;
     Url        = url;
     Exception  = exception ?? GetException(resultType, url);
 }
Example #7
0
 public static VideoParseException GetException(VideoUrlParseResultType resultType, string url) => resultType switch
 {
 public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, string message)
 {
     return CreateError(url, resultType, new VideoParseException(message));
 }
 public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, VideoParseException exception = null)
 {
     return new VideoUrlParseResult(resultType, url, exception);
 }