ILibraryManager.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. #nullable disable
  2. #pragma warning disable CA1002, CS1591
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using Emby.Naming.Common;
  8. using Jellyfin.Data.Entities;
  9. using Jellyfin.Data.Enums;
  10. using MediaBrowser.Controller.Dto;
  11. using MediaBrowser.Controller.Entities;
  12. using MediaBrowser.Controller.Entities.Audio;
  13. using MediaBrowser.Controller.Providers;
  14. using MediaBrowser.Controller.Resolvers;
  15. using MediaBrowser.Controller.Sorting;
  16. using MediaBrowser.Model.Configuration;
  17. using MediaBrowser.Model.Dto;
  18. using MediaBrowser.Model.Entities;
  19. using MediaBrowser.Model.IO;
  20. using MediaBrowser.Model.Querying;
  21. using Episode = MediaBrowser.Controller.Entities.TV.Episode;
  22. using Genre = MediaBrowser.Controller.Entities.Genre;
  23. using Person = MediaBrowser.Controller.Entities.Person;
  24. namespace MediaBrowser.Controller.Library
  25. {
  26. /// <summary>
  27. /// Interface ILibraryManager.
  28. /// </summary>
  29. public interface ILibraryManager
  30. {
  31. /// <summary>
  32. /// Occurs when [item added].
  33. /// </summary>
  34. event EventHandler<ItemChangeEventArgs> ItemAdded;
  35. /// <summary>
  36. /// Occurs when [item updated].
  37. /// </summary>
  38. event EventHandler<ItemChangeEventArgs> ItemUpdated;
  39. /// <summary>
  40. /// Occurs when [item removed].
  41. /// </summary>
  42. event EventHandler<ItemChangeEventArgs> ItemRemoved;
  43. /// <summary>
  44. /// Gets the root folder.
  45. /// </summary>
  46. /// <value>The root folder.</value>
  47. AggregateFolder RootFolder { get; }
  48. bool IsScanRunning { get; }
  49. /// <summary>
  50. /// Resolves the path.
  51. /// </summary>
  52. /// <param name="fileInfo">The file information.</param>
  53. /// <param name="parent">The parent.</param>
  54. /// <returns>BaseItem.</returns>
  55. BaseItem ResolvePath(
  56. FileSystemMetadata fileInfo,
  57. Folder parent = null);
  58. /// <summary>
  59. /// Resolves a set of files into a list of BaseItem.
  60. /// </summary>
  61. /// <param name="files">The list of tiles.</param>
  62. /// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
  63. /// <param name="parent">The parent folder.</param>
  64. /// <param name="libraryOptions">The library options.</param>
  65. /// <param name="collectionType">The collection type.</param>
  66. /// <returns>The items resolved from the paths.</returns>
  67. IEnumerable<BaseItem> ResolvePaths(
  68. IEnumerable<FileSystemMetadata> files,
  69. IDirectoryService directoryService,
  70. Folder parent,
  71. LibraryOptions libraryOptions,
  72. string collectionType = null);
  73. /// <summary>
  74. /// Gets a Person.
  75. /// </summary>
  76. /// <param name="name">The name of the person.</param>
  77. /// <returns>Task{Person}.</returns>
  78. Person GetPerson(string name);
  79. /// <summary>
  80. /// Finds the by path.
  81. /// </summary>
  82. /// <param name="path">The path.</param>
  83. /// <param name="isFolder"><c>true</c> is the path is a directory; otherwise <c>false</c>.</param>
  84. /// <returns>BaseItem.</returns>
  85. BaseItem FindByPath(string path, bool? isFolder);
  86. /// <summary>
  87. /// Gets the artist.
  88. /// </summary>
  89. /// <param name="name">The name of the artist.</param>
  90. /// <returns>Task{Artist}.</returns>
  91. MusicArtist GetArtist(string name);
  92. MusicArtist GetArtist(string name, DtoOptions options);
  93. /// <summary>
  94. /// Gets a Studio.
  95. /// </summary>
  96. /// <param name="name">The name of the studio.</param>
  97. /// <returns>Task{Studio}.</returns>
  98. Studio GetStudio(string name);
  99. /// <summary>
  100. /// Gets a Genre.
  101. /// </summary>
  102. /// <param name="name">The name of the genre.</param>
  103. /// <returns>Task{Genre}.</returns>
  104. Genre GetGenre(string name);
  105. /// <summary>
  106. /// Gets the genre.
  107. /// </summary>
  108. /// <param name="name">The name of the music genre.</param>
  109. /// <returns>Task{MusicGenre}.</returns>
  110. MusicGenre GetMusicGenre(string name);
  111. /// <summary>
  112. /// Gets a Year.
  113. /// </summary>
  114. /// <param name="value">The value.</param>
  115. /// <returns>Task{Year}.</returns>
  116. /// <exception cref="ArgumentOutOfRangeException">Throws if year is invalid.</exception>
  117. Year GetYear(int value);
  118. /// <summary>
  119. /// Validate and refresh the People sub-set of the IBN.
  120. /// The items are stored in the db but not loaded into memory until actually requested by an operation.
  121. /// </summary>
  122. /// <param name="cancellationToken">The cancellation token.</param>
  123. /// <param name="progress">The progress.</param>
  124. /// <returns>Task.</returns>
  125. Task ValidatePeople(CancellationToken cancellationToken, IProgress<double> progress);
  126. /// <summary>
  127. /// Reloads the root media folder.
  128. /// </summary>
  129. /// <param name="progress">The progress.</param>
  130. /// <param name="cancellationToken">The cancellation token.</param>
  131. /// <returns>Task.</returns>
  132. Task ValidateMediaLibrary(IProgress<double> progress, CancellationToken cancellationToken);
  133. /// <summary>
  134. /// Queues the library scan.
  135. /// </summary>
  136. void QueueLibraryScan();
  137. Task UpdateImagesAsync(BaseItem item, bool forceUpdate = false);
  138. /// <summary>
  139. /// Gets the default view.
  140. /// </summary>
  141. /// <returns>IEnumerable{VirtualFolderInfo}.</returns>
  142. List<VirtualFolderInfo> GetVirtualFolders();
  143. List<VirtualFolderInfo> GetVirtualFolders(bool includeRefreshState);
  144. /// <summary>
  145. /// Gets the item by id.
  146. /// </summary>
  147. /// <param name="id">The id.</param>
  148. /// <returns>BaseItem.</returns>
  149. BaseItem GetItemById(Guid id);
  150. /// <summary>
  151. /// Gets the intros.
  152. /// </summary>
  153. /// <param name="item">The item.</param>
  154. /// <param name="user">The user.</param>
  155. /// <returns>IEnumerable{System.String}.</returns>
  156. Task<IEnumerable<Video>> GetIntros(BaseItem item, User user);
  157. /// <summary>
  158. /// Gets all intro files.
  159. /// </summary>
  160. /// <returns>IEnumerable{System.String}.</returns>
  161. IEnumerable<string> GetAllIntroFiles();
  162. /// <summary>
  163. /// Adds the parts.
  164. /// </summary>
  165. /// <param name="rules">The rules.</param>
  166. /// <param name="resolvers">The resolvers.</param>
  167. /// <param name="introProviders">The intro providers.</param>
  168. /// <param name="itemComparers">The item comparers.</param>
  169. /// <param name="postscanTasks">The postscan tasks.</param>
  170. void AddParts(
  171. IEnumerable<IResolverIgnoreRule> rules,
  172. IEnumerable<IItemResolver> resolvers,
  173. IEnumerable<IIntroProvider> introProviders,
  174. IEnumerable<IBaseItemComparer> itemComparers,
  175. IEnumerable<ILibraryPostScanTask> postscanTasks);
  176. /// <summary>
  177. /// Sorts the specified items.
  178. /// </summary>
  179. /// <param name="items">The items.</param>
  180. /// <param name="user">The user.</param>
  181. /// <param name="sortBy">The sort by.</param>
  182. /// <param name="sortOrder">The sort order.</param>
  183. /// <returns>IEnumerable{BaseItem}.</returns>
  184. IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<string> sortBy, SortOrder sortOrder);
  185. IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ValueTuple<string, SortOrder>> orderBy);
  186. /// <summary>
  187. /// Gets the user root folder.
  188. /// </summary>
  189. /// <returns>UserRootFolder.</returns>
  190. Folder GetUserRootFolder();
  191. /// <summary>
  192. /// Creates the item.
  193. /// </summary>
  194. /// <param name="item">Item to create.</param>
  195. /// <param name="parent">Parent of new item.</param>
  196. void CreateItem(BaseItem item, BaseItem parent);
  197. /// <summary>
  198. /// Creates the items.
  199. /// </summary>
  200. /// <param name="items">Items to create.</param>
  201. /// <param name="parent">Parent of new items.</param>
  202. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  203. void CreateItems(IReadOnlyList<BaseItem> items, BaseItem parent, CancellationToken cancellationToken);
  204. /// <summary>
  205. /// Updates the item.
  206. /// </summary>
  207. /// <param name="items">Items to update.</param>
  208. /// <param name="parent">Parent of updated items.</param>
  209. /// <param name="updateReason">Reason for update.</param>
  210. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  211. /// <returns>Returns a Task that can be awaited.</returns>
  212. Task UpdateItemsAsync(IReadOnlyList<BaseItem> items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
  213. /// <summary>
  214. /// Updates the item.
  215. /// </summary>
  216. /// <param name="item">The item.</param>
  217. /// <param name="parent">The parent item.</param>
  218. /// <param name="updateReason">The update reason.</param>
  219. /// <param name="cancellationToken">The cancellation token.</param>
  220. /// <returns>Returns a Task that can be awaited.</returns>
  221. Task UpdateItemAsync(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
  222. /// <summary>
  223. /// Retrieves the item.
  224. /// </summary>
  225. /// <param name="id">The id.</param>
  226. /// <returns>BaseItem.</returns>
  227. BaseItem RetrieveItem(Guid id);
  228. /// <summary>
  229. /// Finds the type of the collection.
  230. /// </summary>
  231. /// <param name="item">The item.</param>
  232. /// <returns>System.String.</returns>
  233. string GetContentType(BaseItem item);
  234. /// <summary>
  235. /// Gets the type of the inherited content.
  236. /// </summary>
  237. /// <param name="item">The item.</param>
  238. /// <returns>System.String.</returns>
  239. string GetInheritedContentType(BaseItem item);
  240. /// <summary>
  241. /// Gets the type of the configured content.
  242. /// </summary>
  243. /// <param name="item">The item.</param>
  244. /// <returns>System.String.</returns>
  245. string GetConfiguredContentType(BaseItem item);
  246. /// <summary>
  247. /// Gets the type of the configured content.
  248. /// </summary>
  249. /// <param name="path">The path.</param>
  250. /// <returns>System.String.</returns>
  251. string GetConfiguredContentType(string path);
  252. /// <summary>
  253. /// Normalizes the root path list.
  254. /// </summary>
  255. /// <param name="paths">The paths.</param>
  256. /// <returns>IEnumerable{System.String}.</returns>
  257. List<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths);
  258. /// <summary>
  259. /// Registers the item.
  260. /// </summary>
  261. /// <param name="item">The item.</param>
  262. void RegisterItem(BaseItem item);
  263. /// <summary>
  264. /// Deletes the item.
  265. /// </summary>
  266. /// <param name="item">Item to delete.</param>
  267. /// <param name="options">Options to use for deletion.</param>
  268. void DeleteItem(BaseItem item, DeleteOptions options);
  269. /// <summary>
  270. /// Deletes the item.
  271. /// </summary>
  272. /// <param name="item">Item to delete.</param>
  273. /// <param name="options">Options to use for deletion.</param>
  274. /// <param name="notifyParentItem">Notify parent of deletion.</param>
  275. void DeleteItem(BaseItem item, DeleteOptions options, bool notifyParentItem);
  276. /// <summary>
  277. /// Deletes the item.
  278. /// </summary>
  279. /// <param name="item">Item to delete.</param>
  280. /// <param name="options">Options to use for deletion.</param>
  281. /// <param name="parent">Parent of item.</param>
  282. /// <param name="notifyParentItem">Notify parent of deletion.</param>
  283. void DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, bool notifyParentItem);
  284. /// <summary>
  285. /// Gets the named view.
  286. /// </summary>
  287. /// <param name="user">The user.</param>
  288. /// <param name="name">The name.</param>
  289. /// <param name="parentId">The parent identifier.</param>
  290. /// <param name="viewType">Type of the view.</param>
  291. /// <param name="sortName">Name of the sort.</param>
  292. /// <returns>The named view.</returns>
  293. UserView GetNamedView(
  294. User user,
  295. string name,
  296. Guid parentId,
  297. string viewType,
  298. string sortName);
  299. /// <summary>
  300. /// Gets the named view.
  301. /// </summary>
  302. /// <param name="user">The user.</param>
  303. /// <param name="name">The name.</param>
  304. /// <param name="viewType">Type of the view.</param>
  305. /// <param name="sortName">Name of the sort.</param>
  306. /// <returns>The named view.</returns>
  307. UserView GetNamedView(
  308. User user,
  309. string name,
  310. string viewType,
  311. string sortName);
  312. /// <summary>
  313. /// Gets the named view.
  314. /// </summary>
  315. /// <param name="name">The name.</param>
  316. /// <param name="viewType">Type of the view.</param>
  317. /// <param name="sortName">Name of the sort.</param>
  318. /// <returns>The named view.</returns>
  319. UserView GetNamedView(
  320. string name,
  321. string viewType,
  322. string sortName);
  323. /// <summary>
  324. /// Gets the named view.
  325. /// </summary>
  326. /// <param name="name">The name.</param>
  327. /// <param name="parentId">The parent identifier.</param>
  328. /// <param name="viewType">Type of the view.</param>
  329. /// <param name="sortName">Name of the sort.</param>
  330. /// <param name="uniqueId">The unique identifier.</param>
  331. /// <returns>The named view.</returns>
  332. UserView GetNamedView(
  333. string name,
  334. Guid parentId,
  335. string viewType,
  336. string sortName,
  337. string uniqueId);
  338. /// <summary>
  339. /// Gets the shadow view.
  340. /// </summary>
  341. /// <param name="parent">The parent.</param>
  342. /// <param name="viewType">Type of the view.</param>
  343. /// <param name="sortName">Name of the sort.</param>
  344. /// <returns>The shadow view.</returns>
  345. UserView GetShadowView(
  346. BaseItem parent,
  347. string viewType,
  348. string sortName);
  349. /// <summary>
  350. /// Determines whether [is video file] [the specified path].
  351. /// </summary>
  352. /// <param name="path">The path.</param>
  353. /// <returns><c>true</c> if [is video file] [the specified path]; otherwise, <c>false</c>.</returns>
  354. bool IsVideoFile(string path);
  355. /// <summary>
  356. /// Determines whether [is audio file] [the specified path].
  357. /// </summary>
  358. /// <param name="path">The path.</param>
  359. /// <returns><c>true</c> if [is audio file] [the specified path]; otherwise, <c>false</c>.</returns>
  360. bool IsAudioFile(string path);
  361. /// <summary>
  362. /// Gets the season number from path.
  363. /// </summary>
  364. /// <param name="path">The path.</param>
  365. /// <returns>System.Nullable&lt;System.Int32&gt;.</returns>
  366. int? GetSeasonNumberFromPath(string path);
  367. /// <summary>
  368. /// Fills the missing episode numbers from path.
  369. /// </summary>
  370. /// <param name="episode">Episode to use.</param>
  371. /// <param name="forceRefresh">Option to force refresh of episode numbers.</param>
  372. /// <returns>True if successful.</returns>
  373. bool FillMissingEpisodeNumbersFromPath(Episode episode, bool forceRefresh);
  374. /// <summary>
  375. /// Parses the name.
  376. /// </summary>
  377. /// <param name="name">The name.</param>
  378. /// <returns>ItemInfo.</returns>
  379. ItemLookupInfo ParseName(string name);
  380. /// <summary>
  381. /// Gets the new item identifier.
  382. /// </summary>
  383. /// <param name="key">The key.</param>
  384. /// <param name="type">The type.</param>
  385. /// <returns>Guid.</returns>
  386. Guid GetNewItemId(string key, Type type);
  387. /// <summary>
  388. /// Finds the trailers.
  389. /// </summary>
  390. /// <param name="owner">The owner.</param>
  391. /// <param name="fileSystemChildren">The file system children.</param>
  392. /// <param name="directoryService">The directory service.</param>
  393. /// <returns>IEnumerable&lt;Trailer&gt;.</returns>
  394. IEnumerable<Video> FindTrailers(
  395. BaseItem owner,
  396. List<FileSystemMetadata> fileSystemChildren,
  397. IDirectoryService directoryService);
  398. /// <summary>
  399. /// Finds the extras.
  400. /// </summary>
  401. /// <param name="owner">The owner.</param>
  402. /// <param name="fileSystemChildren">The file system children.</param>
  403. /// <param name="directoryService">The directory service.</param>
  404. /// <returns>IEnumerable&lt;Video&gt;.</returns>
  405. IEnumerable<Video> FindExtras(
  406. BaseItem owner,
  407. List<FileSystemMetadata> fileSystemChildren,
  408. IDirectoryService directoryService);
  409. /// <summary>
  410. /// Gets the collection folders.
  411. /// </summary>
  412. /// <param name="item">The item.</param>
  413. /// <returns>IEnumerable&lt;Folder&gt;.</returns>
  414. List<Folder> GetCollectionFolders(BaseItem item);
  415. List<Folder> GetCollectionFolders(BaseItem item, List<Folder> allUserRootChildren);
  416. LibraryOptions GetLibraryOptions(BaseItem item);
  417. /// <summary>
  418. /// Gets the people.
  419. /// </summary>
  420. /// <param name="item">The item.</param>
  421. /// <returns>List&lt;PersonInfo&gt;.</returns>
  422. List<PersonInfo> GetPeople(BaseItem item);
  423. /// <summary>
  424. /// Gets the people.
  425. /// </summary>
  426. /// <param name="query">The query.</param>
  427. /// <returns>List&lt;PersonInfo&gt;.</returns>
  428. List<PersonInfo> GetPeople(InternalPeopleQuery query);
  429. /// <summary>
  430. /// Gets the people items.
  431. /// </summary>
  432. /// <param name="query">The query.</param>
  433. /// <returns>List&lt;Person&gt;.</returns>
  434. List<Person> GetPeopleItems(InternalPeopleQuery query);
  435. /// <summary>
  436. /// Updates the people.
  437. /// </summary>
  438. /// <param name="item">The item.</param>
  439. /// <param name="people">The people.</param>
  440. void UpdatePeople(BaseItem item, List<PersonInfo> people);
  441. /// <summary>
  442. /// Asynchronously updates the people.
  443. /// </summary>
  444. /// <param name="item">The item.</param>
  445. /// <param name="people">The people.</param>
  446. /// <param name="cancellationToken">The cancellation token.</param>
  447. /// <returns>The async task.</returns>
  448. Task UpdatePeopleAsync(BaseItem item, List<PersonInfo> people, CancellationToken cancellationToken);
  449. /// <summary>
  450. /// Gets the item ids.
  451. /// </summary>
  452. /// <param name="query">The query.</param>
  453. /// <returns>List&lt;Guid&gt;.</returns>
  454. List<Guid> GetItemIds(InternalItemsQuery query);
  455. /// <summary>
  456. /// Gets the people names.
  457. /// </summary>
  458. /// <param name="query">The query.</param>
  459. /// <returns>List&lt;System.String&gt;.</returns>
  460. List<string> GetPeopleNames(InternalPeopleQuery query);
  461. /// <summary>
  462. /// Queries the items.
  463. /// </summary>
  464. /// <param name="query">The query.</param>
  465. /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
  466. QueryResult<BaseItem> QueryItems(InternalItemsQuery query);
  467. string GetPathAfterNetworkSubstitution(string path, BaseItem ownerItem = null);
  468. /// <summary>
  469. /// Substitutes the path.
  470. /// </summary>
  471. /// <param name="path">The path.</param>
  472. /// <param name="from">From.</param>
  473. /// <param name="to">To.</param>
  474. /// <returns>System.String.</returns>
  475. string SubstitutePath(string path, string from, string to);
  476. /// <summary>
  477. /// Converts the image to local.
  478. /// </summary>
  479. /// <param name="item">The item.</param>
  480. /// <param name="image">The image.</param>
  481. /// <param name="imageIndex">Index of the image.</param>
  482. /// <returns>Task.</returns>
  483. Task<ItemImageInfo> ConvertImageToLocal(BaseItem item, ItemImageInfo image, int imageIndex);
  484. /// <summary>
  485. /// Gets the items.
  486. /// </summary>
  487. /// <param name="query">The query.</param>
  488. /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
  489. List<BaseItem> GetItemList(InternalItemsQuery query);
  490. List<BaseItem> GetItemList(InternalItemsQuery query, bool allowExternalContent);
  491. /// <summary>
  492. /// Gets the items.
  493. /// </summary>
  494. /// <param name="query">The query to use.</param>
  495. /// <param name="parents">Items to use for query.</param>
  496. /// <returns>List of items.</returns>
  497. List<BaseItem> GetItemList(InternalItemsQuery query, List<BaseItem> parents);
  498. /// <summary>
  499. /// Gets the items result.
  500. /// </summary>
  501. /// <param name="query">The query.</param>
  502. /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
  503. QueryResult<BaseItem> GetItemsResult(InternalItemsQuery query);
  504. /// <summary>
  505. /// Ignores the file.
  506. /// </summary>
  507. /// <param name="file">The file.</param>
  508. /// <param name="parent">The parent.</param>
  509. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  510. bool IgnoreFile(FileSystemMetadata file, BaseItem parent);
  511. Guid GetStudioId(string name);
  512. Guid GetGenreId(string name);
  513. Guid GetMusicGenreId(string name);
  514. Task AddVirtualFolder(string name, CollectionTypeOptions? collectionType, LibraryOptions options, bool refreshLibrary);
  515. Task RemoveVirtualFolder(string name, bool refreshLibrary);
  516. void AddMediaPath(string virtualFolderName, MediaPathInfo path);
  517. void UpdateMediaPath(string virtualFolderName, MediaPathInfo path);
  518. void RemoveMediaPath(string virtualFolderName, string path);
  519. QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query);
  520. QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query);
  521. QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query);
  522. QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query);
  523. QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query);
  524. QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query);
  525. int GetCount(InternalItemsQuery query);
  526. void AddExternalSubtitleStreams(
  527. List<MediaStream> streams,
  528. string videoPath,
  529. string[] files);
  530. Task RunMetadataSavers(BaseItem item, ItemUpdateType updateReason);
  531. BaseItem GetParentItem(string parentId, Guid? userId);
  532. BaseItem GetParentItem(Guid? parentId, Guid? userId);
  533. /// <summary>
  534. /// Gets or creates a static instance of <see cref="NamingOptions"/>.
  535. /// </summary>
  536. /// <returns>An instance of the <see cref="NamingOptions"/> class.</returns>
  537. NamingOptions GetNamingOptions();
  538. }
  539. }