internal BaseFile GetFile(PlainFolder aParent, FileInfo info) { BaseFile item; lock (ids) { item = ids.GetItemByPath(info.FullName) as BaseFile; } if (item != null && item.InfoDate == info.LastAccessTimeUtc && item.InfoSize == info.Length) { return(item); } var ext = re_sansitizeExt.Replace(info.Extension.ToLower().Substring(1), string.Empty); var type = DlnaMaps.Ext2Dlna[ext]; var mediaType = DlnaMaps.Ext2Media[ext]; if (store != null) { item = store.MaybeGetFile(this, info, type); if (item != null) { return(item); } } return(BaseFile.GetFile(aParent, info, type, mediaType)); }
internal BaseFile GetFile(PlainFolder aParent, FileInfo info) { BaseFile item; lock (ids) { item = ids.GetItemByPath(info.FullName) as BaseFile; } if (item != null && item.InfoDate == info.LastAccessTimeUtc && item.InfoSize == info.Length) { return(item); } var ext = re_sansitizeExt.Replace( info.Extension.ToUpperInvariant().Substring(1), string.Empty ); var type = DlnaMaps.Ext2Dlna[ext]; var mediaType = DlnaMaps.Ext2Media[ext]; if (store != null) { item = store.MaybeGetFile(this, info, type); if (item != null) { lock (this) { pendingFiles.Add(new WeakReference(item)); } return(item); } } lock (this) { var rv = BaseFile.GetFile(aParent, info, type, mediaType); pendingFiles.Add(new WeakReference(rv)); return(rv); } }