IApiClient.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. using MediaBrowser.Model.Configuration;
  2. using MediaBrowser.Model.Dto;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.Globalization;
  5. using MediaBrowser.Model.Notifications;
  6. using MediaBrowser.Model.Plugins;
  7. using MediaBrowser.Model.Querying;
  8. using MediaBrowser.Model.Serialization;
  9. using MediaBrowser.Model.Session;
  10. using MediaBrowser.Model.System;
  11. using MediaBrowser.Model.Tasks;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.IO;
  15. using System.Threading.Tasks;
  16. namespace MediaBrowser.Model.ApiClient
  17. {
  18. public interface IApiClient : IDisposable
  19. {
  20. /// <summary>
  21. /// Marks the notifications read.
  22. /// </summary>
  23. /// <param name="userId">The user id.</param>
  24. /// <param name="notificationIdList">The notification id list.</param>
  25. /// <param name="isRead">if set to <c>true</c> [is read].</param>
  26. /// <returns>Task.</returns>
  27. Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead);
  28. /// <summary>
  29. /// Updates the notification.
  30. /// </summary>
  31. /// <param name="notification">The notification.</param>
  32. /// <returns>Task.</returns>
  33. Task UpdateNotification(Notification notification);
  34. /// <summary>
  35. /// Adds the notification.
  36. /// </summary>
  37. /// <param name="notification">The notification.</param>
  38. /// <returns>Task{Notification}.</returns>
  39. Task<Notification> AddNotification(Notification notification);
  40. /// <summary>
  41. /// Gets the notifications summary.
  42. /// </summary>
  43. /// <param name="userId">The user id.</param>
  44. /// <returns>Task{NotificationsSummary}.</returns>
  45. Task<NotificationsSummary> GetNotificationsSummary(string userId);
  46. /// <summary>
  47. /// Gets the notifications async.
  48. /// </summary>
  49. /// <param name="query">The query.</param>
  50. /// <returns>Task{NotificationResult}.</returns>
  51. Task<NotificationResult> GetNotificationsAsync(NotificationQuery query);
  52. /// <summary>
  53. /// Gets an image stream based on a url
  54. /// </summary>
  55. /// <param name="url">The URL.</param>
  56. /// <returns>Task{Stream}.</returns>
  57. /// <exception cref="ArgumentNullException">url</exception>
  58. Task<Stream> GetImageStreamAsync(string url);
  59. /// <summary>
  60. /// Gets a BaseItem
  61. /// </summary>
  62. /// <param name="id">The id.</param>
  63. /// <param name="userId">The user id.</param>
  64. /// <returns>Task{BaseItemDto}.</returns>
  65. /// <exception cref="ArgumentNullException">id</exception>
  66. Task<BaseItemDto> GetItemAsync(string id, string userId);
  67. /// <summary>
  68. /// Gets the intros async.
  69. /// </summary>
  70. /// <param name="itemId">The item id.</param>
  71. /// <param name="userId">The user id.</param>
  72. /// <returns>Task{System.String[]}.</returns>
  73. /// <exception cref="ArgumentNullException">id</exception>
  74. Task<string[]> GetIntrosAsync(string itemId, string userId);
  75. /// <summary>
  76. /// Gets a BaseItem
  77. /// </summary>
  78. /// <param name="userId">The user id.</param>
  79. /// <returns>Task{BaseItemDto}.</returns>
  80. /// <exception cref="ArgumentNullException">userId</exception>
  81. Task<BaseItemDto> GetRootFolderAsync(string userId);
  82. /// <summary>
  83. /// Gets the users async.
  84. /// </summary>
  85. /// <returns>Task{UserDto[]}.</returns>
  86. Task<UserDto[]> GetUsersAsync();
  87. /// <summary>
  88. /// Gets active client sessions.
  89. /// </summary>
  90. /// <returns>Task{SessionInfoDto[]}.</returns>
  91. Task<SessionInfoDto[]> GetClientSessionsAsync();
  92. /// <summary>
  93. /// Gets the item counts async.
  94. /// </summary>
  95. /// <param name="userId">The user id.</param>
  96. /// <returns>Task{ItemCounts}.</returns>
  97. Task<ItemCounts> GetItemCountsAsync(string userId);
  98. /// <summary>
  99. /// Queries for items
  100. /// </summary>
  101. /// <param name="query">The query.</param>
  102. /// <returns>Task{ItemsResult}.</returns>
  103. /// <exception cref="ArgumentNullException">query</exception>
  104. Task<ItemsResult> GetItemsAsync(ItemQuery query);
  105. /// <summary>
  106. /// Gets the similar movies async.
  107. /// </summary>
  108. /// <param name="query">The query.</param>
  109. /// <returns>Task{ItemsResult}.</returns>
  110. Task<ItemsResult> GetSimilarMoviesAsync(SimilarItemsQuery query);
  111. /// <summary>
  112. /// Gets the similar series async.
  113. /// </summary>
  114. /// <param name="query">The query.</param>
  115. /// <returns>Task{ItemsResult}.</returns>
  116. Task<ItemsResult> GetSimilarSeriesAsync(SimilarItemsQuery query);
  117. /// <summary>
  118. /// Gets the similar albums async.
  119. /// </summary>
  120. /// <param name="query">The query.</param>
  121. /// <returns>Task{ItemsResult}.</returns>
  122. Task<ItemsResult> GetSimilarAlbumsAsync(SimilarItemsQuery query);
  123. /// <summary>
  124. /// Gets the similar games async.
  125. /// </summary>
  126. /// <param name="query">The query.</param>
  127. /// <returns>Task{ItemsResult}.</returns>
  128. Task<ItemsResult> GetSimilarGamesAsync(SimilarItemsQuery query);
  129. /// <summary>
  130. /// Gets the people async.
  131. /// </summary>
  132. /// <param name="query">The query.</param>
  133. /// <returns>Task{ItemsResult}.</returns>
  134. /// <exception cref="ArgumentNullException">userId</exception>
  135. Task<ItemsResult> GetPeopleAsync(PersonsQuery query);
  136. /// <summary>
  137. /// Gets the artists.
  138. /// </summary>
  139. /// <param name="query">The query.</param>
  140. /// <returns>Task{ItemsResult}.</returns>
  141. /// <exception cref="ArgumentNullException">userId</exception>
  142. Task<ItemsResult> GetArtistsAsync(ArtistsQuery query);
  143. /// <summary>
  144. /// Gets a studio
  145. /// </summary>
  146. /// <param name="name">The name.</param>
  147. /// <returns>Task{BaseItemDto}.</returns>
  148. /// <exception cref="ArgumentNullException">userId</exception>
  149. Task<BaseItemDto> GetStudioAsync(string name);
  150. /// <summary>
  151. /// Gets the next up async.
  152. /// </summary>
  153. /// <param name="query">The query.</param>
  154. /// <returns>Task{ItemsResult}.</returns>
  155. Task<ItemsResult> GetNextUpAsync(NextUpQuery query);
  156. /// <summary>
  157. /// Gets a genre
  158. /// </summary>
  159. /// <param name="name">The name.</param>
  160. /// <returns>Task{BaseItemDto}.</returns>
  161. /// <exception cref="ArgumentNullException">userId</exception>
  162. Task<BaseItemDto> GetGenreAsync(string name);
  163. /// <summary>
  164. /// Gets the artist async.
  165. /// </summary>
  166. /// <param name="name">The name.</param>
  167. /// <returns>Task{BaseItemDto}.</returns>
  168. /// <exception cref="ArgumentNullException">name</exception>
  169. Task<BaseItemDto> GetArtistAsync(string name);
  170. /// <summary>
  171. /// Restarts the kernel or the entire server if necessary
  172. /// If the server application is restarting this request will fail to return, even if
  173. /// the operation is successful.
  174. /// </summary>
  175. /// <returns>Task.</returns>
  176. Task PerformPendingRestartAsync();
  177. /// <summary>
  178. /// Gets the system status async.
  179. /// </summary>
  180. /// <returns>Task{SystemInfo}.</returns>
  181. Task<SystemInfo> GetSystemInfoAsync();
  182. /// <summary>
  183. /// Gets a person
  184. /// </summary>
  185. /// <param name="name">The name.</param>
  186. /// <returns>Task{BaseItemDto}.</returns>
  187. /// <exception cref="ArgumentNullException">userId</exception>
  188. Task<BaseItemDto> GetPersonAsync(string name);
  189. /// <summary>
  190. /// Gets a year
  191. /// </summary>
  192. /// <param name="year">The year.</param>
  193. /// <returns>Task{BaseItemDto}.</returns>
  194. /// <exception cref="ArgumentNullException">userId</exception>
  195. Task<BaseItemDto> GetYearAsync(int year);
  196. /// <summary>
  197. /// Gets a list of plugins installed on the server
  198. /// </summary>
  199. /// <returns>Task{PluginInfo[]}.</returns>
  200. Task<PluginInfo[]> GetInstalledPluginsAsync();
  201. /// <summary>
  202. /// Gets the current server configuration
  203. /// </summary>
  204. /// <returns>Task{ServerConfiguration}.</returns>
  205. Task<ServerConfiguration> GetServerConfigurationAsync();
  206. /// <summary>
  207. /// Gets the scheduled tasks.
  208. /// </summary>
  209. /// <returns>Task{TaskInfo[]}.</returns>
  210. Task<TaskInfo[]> GetScheduledTasksAsync();
  211. /// <summary>
  212. /// Gets the scheduled task async.
  213. /// </summary>
  214. /// <param name="id">The id.</param>
  215. /// <returns>Task{TaskInfo}.</returns>
  216. /// <exception cref="ArgumentNullException">id</exception>
  217. Task<TaskInfo> GetScheduledTaskAsync(Guid id);
  218. /// <summary>
  219. /// Gets a user by id
  220. /// </summary>
  221. /// <param name="id">The id.</param>
  222. /// <returns>Task{UserDto}.</returns>
  223. /// <exception cref="ArgumentNullException">id</exception>
  224. Task<UserDto> GetUserAsync(string id);
  225. /// <summary>
  226. /// Gets the parental ratings async.
  227. /// </summary>
  228. /// <returns>Task{List{ParentalRating}}.</returns>
  229. Task<List<ParentalRating>> GetParentalRatingsAsync();
  230. /// <summary>
  231. /// Gets local trailers for an item
  232. /// </summary>
  233. /// <param name="userId">The user id.</param>
  234. /// <param name="itemId">The item id.</param>
  235. /// <returns>Task{ItemsResult}.</returns>
  236. /// <exception cref="ArgumentNullException">query</exception>
  237. Task<BaseItemDto[]> GetLocalTrailersAsync(string userId, string itemId);
  238. /// <summary>
  239. /// Gets special features for an item
  240. /// </summary>
  241. /// <param name="userId">The user id.</param>
  242. /// <param name="itemId">The item id.</param>
  243. /// <returns>Task{BaseItemDto[]}.</returns>
  244. /// <exception cref="ArgumentNullException">userId</exception>
  245. Task<BaseItemDto[]> GetSpecialFeaturesAsync(string userId, string itemId);
  246. /// <summary>
  247. /// Gets the cultures async.
  248. /// </summary>
  249. /// <returns>Task{CultureDto[]}.</returns>
  250. Task<CultureDto[]> GetCulturesAsync();
  251. /// <summary>
  252. /// Gets the countries async.
  253. /// </summary>
  254. /// <returns>Task{CountryInfo[]}.</returns>
  255. Task<CountryInfo[]> GetCountriesAsync();
  256. /// <summary>
  257. /// Marks an item as played or unplayed.
  258. /// This should not be used to update playstate following playback.
  259. /// There are separate playstate check-in methods for that. This should be used for a
  260. /// separate option to reset playstate.
  261. /// </summary>
  262. /// <param name="itemId">The item id.</param>
  263. /// <param name="userId">The user id.</param>
  264. /// <param name="wasPlayed">if set to <c>true</c> [was played].</param>
  265. /// <returns>Task.</returns>
  266. /// <exception cref="ArgumentNullException">itemId</exception>
  267. Task UpdatePlayedStatusAsync(string itemId, string userId, bool wasPlayed);
  268. /// <summary>
  269. /// Updates the favorite status async.
  270. /// </summary>
  271. /// <param name="itemId">The item id.</param>
  272. /// <param name="userId">The user id.</param>
  273. /// <param name="isFavorite">if set to <c>true</c> [is favorite].</param>
  274. /// <returns>Task.</returns>
  275. /// <exception cref="ArgumentNullException">itemId</exception>
  276. Task UpdateFavoriteStatusAsync(string itemId, string userId, bool isFavorite);
  277. /// <summary>
  278. /// Reports to the server that the user has begun playing an item
  279. /// </summary>
  280. /// <param name="itemId">The item id.</param>
  281. /// <param name="userId">The user id.</param>
  282. /// <returns>Task{UserItemDataDto}.</returns>
  283. /// <exception cref="ArgumentNullException">itemId</exception>
  284. Task ReportPlaybackStartAsync(string itemId, string userId);
  285. /// <summary>
  286. /// Reports playback progress to the server
  287. /// </summary>
  288. /// <param name="itemId">The item id.</param>
  289. /// <param name="userId">The user id.</param>
  290. /// <param name="positionTicks">The position ticks.</param>
  291. /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
  292. /// <returns>Task{UserItemDataDto}.</returns>
  293. /// <exception cref="ArgumentNullException">itemId</exception>
  294. Task ReportPlaybackProgressAsync(string itemId, string userId, long? positionTicks, bool isPaused);
  295. /// <summary>
  296. /// Reports to the server that the user has stopped playing an item
  297. /// </summary>
  298. /// <param name="itemId">The item id.</param>
  299. /// <param name="userId">The user id.</param>
  300. /// <param name="positionTicks">The position ticks.</param>
  301. /// <returns>Task{UserItemDataDto}.</returns>
  302. /// <exception cref="ArgumentNullException">itemId</exception>
  303. Task ReportPlaybackStoppedAsync(string itemId, string userId, long? positionTicks);
  304. /// <summary>
  305. /// Instructs antoher client to browse to a library item.
  306. /// </summary>
  307. /// <param name="sessionId">The session id.</param>
  308. /// <param name="itemId">The id of the item to browse to.</param>
  309. /// <param name="itemName">The name of the item to browse to.</param>
  310. /// <param name="itemType">The type of the item to browse to.</param>
  311. /// <param name="context">Optional ui context (movies, music, tv, games, etc). The client is free to ignore this.</param>
  312. /// <returns>Task.</returns>
  313. Task SendBrowseCommandAsync(string sessionId, string itemId, string itemName, string itemType, string context);
  314. /// <summary>
  315. /// Sends the play command async.
  316. /// </summary>
  317. /// <param name="sessionId">The session id.</param>
  318. /// <param name="request">The request.</param>
  319. /// <returns>Task.</returns>
  320. /// <exception cref="ArgumentNullException">
  321. /// sessionId
  322. /// or
  323. /// request
  324. /// </exception>
  325. Task SendPlayCommandAsync(string sessionId, PlayRequest request);
  326. /// <summary>
  327. /// Clears a user's rating for an item
  328. /// </summary>
  329. /// <param name="itemId">The item id.</param>
  330. /// <param name="userId">The user id.</param>
  331. /// <returns>Task{UserItemDataDto}.</returns>
  332. /// <exception cref="ArgumentNullException">itemId</exception>
  333. Task ClearUserItemRatingAsync(string itemId, string userId);
  334. /// <summary>
  335. /// Updates a user's rating for an item, based on likes or dislikes
  336. /// </summary>
  337. /// <param name="itemId">The item id.</param>
  338. /// <param name="userId">The user id.</param>
  339. /// <param name="likes">if set to <c>true</c> [likes].</param>
  340. /// <returns>Task.</returns>
  341. /// <exception cref="ArgumentNullException">itemId</exception>
  342. Task UpdateUserItemRatingAsync(string itemId, string userId, bool likes);
  343. /// <summary>
  344. /// Authenticates a user and returns the result
  345. /// </summary>
  346. /// <param name="userId">The user id.</param>
  347. /// <param name="sha1Hash">The sha1 hash.</param>
  348. /// <returns>Task.</returns>
  349. /// <exception cref="ArgumentNullException">userId</exception>
  350. Task AuthenticateUserAsync(string userId, byte[] sha1Hash);
  351. /// <summary>
  352. /// Updates the server configuration async.
  353. /// </summary>
  354. /// <param name="configuration">The configuration.</param>
  355. /// <returns>Task.</returns>
  356. /// <exception cref="ArgumentNullException">configuration</exception>
  357. Task UpdateServerConfigurationAsync(ServerConfiguration configuration);
  358. /// <summary>
  359. /// Updates the scheduled task triggers.
  360. /// </summary>
  361. /// <param name="id">The id.</param>
  362. /// <param name="triggers">The triggers.</param>
  363. /// <returns>Task{RequestResult}.</returns>
  364. /// <exception cref="ArgumentNullException">id</exception>
  365. Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers);
  366. /// <summary>
  367. /// Gets the display preferences.
  368. /// </summary>
  369. /// <param name="id">The id.</param>
  370. /// <returns>Task{BaseItemDto}.</returns>
  371. Task<DisplayPreferences> GetDisplayPreferencesAsync(string id);
  372. /// <summary>
  373. /// Updates display preferences for a user
  374. /// </summary>
  375. /// <param name="id">The id.</param>
  376. /// <param name="displayPreferences">The display preferences.</param>
  377. /// <returns>Task{DisplayPreferences}.</returns>
  378. /// <exception cref="System.ArgumentNullException">userId</exception>
  379. Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences);
  380. /// <summary>
  381. /// Posts a set of data to a url, and deserializes the return stream into T
  382. /// </summary>
  383. /// <typeparam name="T"></typeparam>
  384. /// <param name="url">The URL.</param>
  385. /// <param name="args">The args.</param>
  386. /// <returns>Task{``0}.</returns>
  387. Task<T> PostAsync<T>(string url, Dictionary<string, string> args)
  388. where T : class;
  389. /// <summary>
  390. /// This is a helper around getting a stream from the server that contains serialized data
  391. /// </summary>
  392. /// <param name="url">The URL.</param>
  393. /// <returns>Task{Stream}.</returns>
  394. Task<Stream> GetSerializedStreamAsync(string url);
  395. /// <summary>
  396. /// Gets the json serializer.
  397. /// </summary>
  398. /// <value>The json serializer.</value>
  399. IJsonSerializer JsonSerializer { get; set; }
  400. /// <summary>
  401. /// Gets or sets the server host name (myserver or 192.168.x.x)
  402. /// </summary>
  403. /// <value>The name of the server host.</value>
  404. string ServerHostName { get; set; }
  405. /// <summary>
  406. /// Gets or sets the port number used by the API
  407. /// </summary>
  408. /// <value>The server API port.</value>
  409. int ServerApiPort { get; set; }
  410. /// <summary>
  411. /// Gets or sets the type of the client.
  412. /// </summary>
  413. /// <value>The type of the client.</value>
  414. string ClientName { get; set; }
  415. /// <summary>
  416. /// Gets or sets the name of the device.
  417. /// </summary>
  418. /// <value>The name of the device.</value>
  419. string DeviceName { get; set; }
  420. /// <summary>
  421. /// Gets or sets the device id.
  422. /// </summary>
  423. /// <value>The device id.</value>
  424. string DeviceId { get; set; }
  425. /// <summary>
  426. /// Gets or sets the current user id.
  427. /// </summary>
  428. /// <value>The current user id.</value>
  429. string CurrentUserId { get; set; }
  430. /// <summary>
  431. /// Gets the image URL.
  432. /// </summary>
  433. /// <param name="item">The item.</param>
  434. /// <param name="options">The options.</param>
  435. /// <returns>System.String.</returns>
  436. /// <exception cref="ArgumentNullException">item</exception>
  437. string GetImageUrl(BaseItemDto item, ImageOptions options);
  438. /// <summary>
  439. /// Gets an image url that can be used to download an image from the api
  440. /// </summary>
  441. /// <param name="itemId">The Id of the item</param>
  442. /// <param name="options">The options.</param>
  443. /// <returns>System.String.</returns>
  444. /// <exception cref="ArgumentNullException">itemId</exception>
  445. string GetImageUrl(string itemId, ImageOptions options);
  446. /// <summary>
  447. /// Gets the user image URL.
  448. /// </summary>
  449. /// <param name="user">The user.</param>
  450. /// <param name="options">The options.</param>
  451. /// <returns>System.String.</returns>
  452. /// <exception cref="ArgumentNullException">user</exception>
  453. string GetUserImageUrl(UserDto user, ImageOptions options);
  454. /// <summary>
  455. /// Gets an image url that can be used to download an image from the api
  456. /// </summary>
  457. /// <param name="userId">The Id of the user</param>
  458. /// <param name="options">The options.</param>
  459. /// <returns>System.String.</returns>
  460. /// <exception cref="ArgumentNullException">userId</exception>
  461. string GetUserImageUrl(string userId, ImageOptions options);
  462. /// <summary>
  463. /// Gets the person image URL.
  464. /// </summary>
  465. /// <param name="item">The item.</param>
  466. /// <param name="options">The options.</param>
  467. /// <returns>System.String.</returns>
  468. /// <exception cref="ArgumentNullException">item</exception>
  469. string GetPersonImageUrl(BaseItemPerson item, ImageOptions options);
  470. /// <summary>
  471. /// Gets the person image URL.
  472. /// </summary>
  473. /// <param name="item">The item.</param>
  474. /// <param name="options">The options.</param>
  475. /// <returns>System.String.</returns>
  476. /// <exception cref="ArgumentNullException">item</exception>
  477. string GetPersonImageUrl(BaseItemDto item, ImageOptions options);
  478. /// <summary>
  479. /// Gets an image url that can be used to download an image from the api
  480. /// </summary>
  481. /// <param name="name">The name of the person</param>
  482. /// <param name="options">The options.</param>
  483. /// <returns>System.String.</returns>
  484. /// <exception cref="ArgumentNullException">name</exception>
  485. string GetPersonImageUrl(string name, ImageOptions options);
  486. /// <summary>
  487. /// Gets the year image URL.
  488. /// </summary>
  489. /// <param name="item">The item.</param>
  490. /// <param name="options">The options.</param>
  491. /// <returns>System.String.</returns>
  492. /// <exception cref="ArgumentNullException">item</exception>
  493. string GetYearImageUrl(BaseItemDto item, ImageOptions options);
  494. /// <summary>
  495. /// Gets an image url that can be used to download an image from the api
  496. /// </summary>
  497. /// <param name="year">The year.</param>
  498. /// <param name="options">The options.</param>
  499. /// <returns>System.String.</returns>
  500. string GetYearImageUrl(int year, ImageOptions options);
  501. /// <summary>
  502. /// Gets the genre image URL.
  503. /// </summary>
  504. /// <param name="item">The item.</param>
  505. /// <param name="options">The options.</param>
  506. /// <returns>System.String.</returns>
  507. /// <exception cref="ArgumentNullException">item</exception>
  508. string GetGenreImageUrl(BaseItemDto item, ImageOptions options);
  509. /// <summary>
  510. /// Gets an image url that can be used to download an image from the api
  511. /// </summary>
  512. /// <param name="name">The name.</param>
  513. /// <param name="options">The options.</param>
  514. /// <returns>System.String.</returns>
  515. /// <exception cref="ArgumentNullException">name</exception>
  516. string GetGenreImageUrl(string name, ImageOptions options);
  517. /// <summary>
  518. /// Gets the studio image URL.
  519. /// </summary>
  520. /// <param name="item">The item.</param>
  521. /// <param name="options">The options.</param>
  522. /// <returns>System.String.</returns>
  523. /// <exception cref="ArgumentNullException">item</exception>
  524. string GetStudioImageUrl(BaseItemDto item, ImageOptions options);
  525. /// <summary>
  526. /// Gets an image url that can be used to download an image from the api
  527. /// </summary>
  528. /// <param name="name">The name.</param>
  529. /// <param name="options">The options.</param>
  530. /// <returns>System.String.</returns>
  531. /// <exception cref="ArgumentNullException">name</exception>
  532. string GetStudioImageUrl(string name, ImageOptions options);
  533. /// <summary>
  534. /// Gets the artist image URL.
  535. /// </summary>
  536. /// <param name="item">The item.</param>
  537. /// <param name="options">The options.</param>
  538. /// <returns>System.String.</returns>
  539. /// <exception cref="ArgumentNullException">item
  540. /// or
  541. /// options</exception>
  542. string GetArtistImageUrl(BaseItemDto item, ImageOptions options);
  543. /// <summary>
  544. /// Gets the artist image URL.
  545. /// </summary>
  546. /// <param name="name">The name.</param>
  547. /// <param name="options">The options.</param>
  548. /// <returns>System.String.</returns>
  549. /// <exception cref="ArgumentNullException">name</exception>
  550. string GetArtistImageUrl(string name, ImageOptions options);
  551. /// <summary>
  552. /// This is a helper to get a list of backdrop url's from a given ApiBaseItemWrapper. If the actual item does not have any backdrops it will return backdrops from the first parent that does.
  553. /// </summary>
  554. /// <param name="item">A given item.</param>
  555. /// <param name="options">The options.</param>
  556. /// <returns>System.String[][].</returns>
  557. /// <exception cref="ArgumentNullException">item</exception>
  558. string[] GetBackdropImageUrls(BaseItemDto item, ImageOptions options);
  559. /// <summary>
  560. /// This is a helper to get the logo image url from a given ApiBaseItemWrapper. If the actual item does not have a logo, it will return the logo from the first parent that does, or null.
  561. /// </summary>
  562. /// <param name="item">A given item.</param>
  563. /// <param name="options">The options.</param>
  564. /// <returns>System.String.</returns>
  565. /// <exception cref="ArgumentNullException">item</exception>
  566. string GetLogoImageUrl(BaseItemDto item, ImageOptions options);
  567. /// <summary>
  568. /// Gets the url needed to stream an audio file
  569. /// </summary>
  570. /// <param name="options">The options.</param>
  571. /// <returns>System.String.</returns>
  572. /// <exception cref="ArgumentNullException">options</exception>
  573. string GetAudioStreamUrl(StreamOptions options);
  574. /// <summary>
  575. /// Gets the url needed to stream a video file
  576. /// </summary>
  577. /// <param name="options">The options.</param>
  578. /// <returns>System.String.</returns>
  579. /// <exception cref="ArgumentNullException">options</exception>
  580. string GetVideoStreamUrl(VideoStreamOptions options);
  581. /// <summary>
  582. /// Formulates a url for streaming audio using the HLS protocol
  583. /// </summary>
  584. /// <param name="options">The options.</param>
  585. /// <returns>System.String.</returns>
  586. /// <exception cref="ArgumentNullException">options</exception>
  587. string GetHlsAudioStreamUrl(StreamOptions options);
  588. /// <summary>
  589. /// Formulates a url for streaming video using the HLS protocol
  590. /// </summary>
  591. /// <param name="options">The options.</param>
  592. /// <returns>System.String.</returns>
  593. /// <exception cref="ArgumentNullException">options</exception>
  594. string GetHlsVideoStreamUrl(VideoStreamOptions options);
  595. }
  596. }