Esempio n. 1
0
 public WebItemSupportStatus GetItemSupportStatus(WebMediaType type, int? provider, string itemId, int? offset)
 {
     // check if we actually now about this file
     MediaSource source = new MediaSource(type, provider, itemId, offset);
     string error = source.CheckAvailability();
     return error != null ?
         new WebItemSupportStatus(false, error) :
         new WebItemSupportStatus(true, null);
 }
Esempio n. 2
0
        /// <param name="smartHash">Use smartHash for calculating a quick hash (only uses part of the media item) or a full MD5 hash</param>
        public WebMediaHash GetItemHash(WebMediaType type, int? provider, string itemId, int? offset, bool smartHash)
        {
            MediaSource source = new MediaSource(type, provider, itemId, offset);
            String error = source.CheckAvailability();
            if (error != null)
            {
                return new WebMediaHash() { Generated = false, Error = error };
            }

            return new WebMediaHash() { Generated = true, Hash = smartHash ? source.ComputeSmartHash() : source.ComputeFullHash() };
        }