IApiClient.cs 30 KB

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