コード例 #1
0
        /// <summary>
        /// Gets the files.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>Task&lt;List&lt;ItemFileInfo&gt;&gt;.</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;
        }
コード例 #2
0
 public SyncJobItem()
 {
     AdditionalFiles = new ItemFileInfo[] { };
 }