/// <summary> /// Gets the files. /// </summary> /// <param name="item">The item.</param> /// <returns>Task<List<ItemFileInfo>>.</returns> public async Task<List<ItemFileInfo>> GetFiles(LocalItem item) { var path = item.LocalPath; path = _fileRepository.GetParentDirectoryPath(path); var list = await _fileRepository.GetFileSystemEntries(path).ConfigureAwait(false); var itemFiles = new List<ItemFileInfo>(); var name = Path.GetFileNameWithoutExtension(item.LocalPath); foreach (var file in list.Where(f => f.Name.Contains(name))) { var itemFile = new ItemFileInfo { Path = file.Path, Name = file.Name }; if (IsSubtitleFile(file.Name)) { itemFile.Type = ItemFileType.Subtitles; } else if (!IsImageFile(file.Name)) { itemFile.Type = ItemFileType.Media; } itemFiles.Add(itemFile); } return itemFiles; }
public SyncJobItem() { AdditionalFiles = new ItemFileInfo[] { }; }