IApiClient.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  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. /// <returns>Task{BaseItemDto}.</returns>
  196. /// <exception cref="ArgumentNullException">userId</exception>
  197. Task<BaseItemDto> GetStudioAsync(string name);
  198. /// <summary>
  199. /// Gets the next up async.
  200. /// </summary>
  201. /// <param name="query">The query.</param>
  202. /// <returns>Task{ItemsResult}.</returns>
  203. Task<ItemsResult> GetNextUpAsync(NextUpQuery query);
  204. /// <summary>
  205. /// Gets a genre
  206. /// </summary>
  207. /// <param name="name">The name.</param>
  208. /// <returns>Task{BaseItemDto}.</returns>
  209. /// <exception cref="ArgumentNullException">userId</exception>
  210. Task<BaseItemDto> GetGenreAsync(string name);
  211. /// <summary>
  212. /// Gets the artist async.
  213. /// </summary>
  214. /// <param name="name">The name.</param>
  215. /// <returns>Task{BaseItemDto}.</returns>
  216. /// <exception cref="ArgumentNullException">name</exception>
  217. Task<BaseItemDto> GetArtistAsync(string name);
  218. /// <summary>
  219. /// Restarts the server.
  220. /// </summary>
  221. /// <returns>Task.</returns>
  222. Task RestartServerAsync();
  223. /// <summary>
  224. /// Gets the system status async.
  225. /// </summary>
  226. /// <returns>Task{SystemInfo}.</returns>
  227. Task<SystemInfo> GetSystemInfoAsync();
  228. /// <summary>
  229. /// Gets a person
  230. /// </summary>
  231. /// <param name="name">The name.</param>
  232. /// <returns>Task{BaseItemDto}.</returns>
  233. /// <exception cref="ArgumentNullException">userId</exception>
  234. Task<BaseItemDto> GetPersonAsync(string name);
  235. /// <summary>
  236. /// Gets a year
  237. /// </summary>
  238. /// <param name="year">The year.</param>
  239. /// <returns>Task{BaseItemDto}.</returns>
  240. /// <exception cref="ArgumentNullException">userId</exception>
  241. Task<BaseItemDto> GetYearAsync(int year);
  242. /// <summary>
  243. /// Gets a list of plugins installed on the server
  244. /// </summary>
  245. /// <returns>Task{PluginInfo[]}.</returns>
  246. Task<PluginInfo[]> GetInstalledPluginsAsync();
  247. /// <summary>
  248. /// Gets the current server configuration
  249. /// </summary>
  250. /// <returns>Task{ServerConfiguration}.</returns>
  251. Task<ServerConfiguration> GetServerConfigurationAsync();
  252. /// <summary>
  253. /// Gets the scheduled tasks.
  254. /// </summary>
  255. /// <returns>Task{TaskInfo[]}.</returns>
  256. Task<TaskInfo[]> GetScheduledTasksAsync();
  257. /// <summary>
  258. /// Gets the scheduled task async.
  259. /// </summary>
  260. /// <param name="id">The id.</param>
  261. /// <returns>Task{TaskInfo}.</returns>
  262. /// <exception cref="ArgumentNullException">id</exception>
  263. Task<TaskInfo> GetScheduledTaskAsync(Guid id);
  264. /// <summary>
  265. /// Gets a user by id
  266. /// </summary>
  267. /// <param name="id">The id.</param>
  268. /// <returns>Task{UserDto}.</returns>
  269. /// <exception cref="ArgumentNullException">id</exception>
  270. Task<UserDto> GetUserAsync(string id);
  271. /// <summary>
  272. /// Gets the parental ratings async.
  273. /// </summary>
  274. /// <returns>Task{List{ParentalRating}}.</returns>
  275. Task<List<ParentalRating>> GetParentalRatingsAsync();
  276. /// <summary>
  277. /// Gets local trailers for an item
  278. /// </summary>
  279. /// <param name="userId">The user id.</param>
  280. /// <param name="itemId">The item id.</param>
  281. /// <returns>Task{ItemsResult}.</returns>
  282. /// <exception cref="ArgumentNullException">query</exception>
  283. Task<BaseItemDto[]> GetLocalTrailersAsync(string userId, string itemId);
  284. /// <summary>
  285. /// Gets special features for an item
  286. /// </summary>
  287. /// <param name="userId">The user id.</param>
  288. /// <param name="itemId">The item id.</param>
  289. /// <returns>Task{BaseItemDto[]}.</returns>
  290. /// <exception cref="ArgumentNullException">userId</exception>
  291. Task<BaseItemDto[]> GetSpecialFeaturesAsync(string userId, string itemId);
  292. /// <summary>
  293. /// Gets the cultures async.
  294. /// </summary>
  295. /// <returns>Task{CultureDto[]}.</returns>
  296. Task<CultureDto[]> GetCulturesAsync();
  297. /// <summary>
  298. /// Gets the countries async.
  299. /// </summary>
  300. /// <returns>Task{CountryInfo[]}.</returns>
  301. Task<CountryInfo[]> GetCountriesAsync();
  302. /// <summary>
  303. /// Marks an item as played or unplayed.
  304. /// This should not be used to update playstate following playback.
  305. /// There are separate playstate check-in methods for that. This should be used for a
  306. /// separate option to reset playstate.
  307. /// </summary>
  308. /// <param name="itemId">The item id.</param>
  309. /// <param name="userId">The user id.</param>
  310. /// <param name="wasPlayed">if set to <c>true</c> [was played].</param>
  311. /// <returns>Task.</returns>
  312. /// <exception cref="ArgumentNullException">itemId</exception>
  313. Task UpdatePlayedStatusAsync(string itemId, string userId, bool wasPlayed);
  314. /// <summary>
  315. /// Updates the favorite status async.
  316. /// </summary>
  317. /// <param name="itemId">The item id.</param>
  318. /// <param name="userId">The user id.</param>
  319. /// <param name="isFavorite">if set to <c>true</c> [is favorite].</param>
  320. /// <returns>Task.</returns>
  321. /// <exception cref="ArgumentNullException">itemId</exception>
  322. Task UpdateFavoriteStatusAsync(string itemId, string userId, bool isFavorite);
  323. /// <summary>
  324. /// Reports to the server that the user has begun playing an item
  325. /// </summary>
  326. /// <param name="itemId">The item id.</param>
  327. /// <param name="userId">The user id.</param>
  328. /// <returns>Task{UserItemDataDto}.</returns>
  329. /// <exception cref="ArgumentNullException">itemId</exception>
  330. Task ReportPlaybackStartAsync(string itemId, string userId);
  331. /// <summary>
  332. /// Reports playback progress to the server
  333. /// </summary>
  334. /// <param name="itemId">The item id.</param>
  335. /// <param name="userId">The user id.</param>
  336. /// <param name="positionTicks">The position ticks.</param>
  337. /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
  338. /// <returns>Task{UserItemDataDto}.</returns>
  339. /// <exception cref="ArgumentNullException">itemId</exception>
  340. Task ReportPlaybackProgressAsync(string itemId, string userId, long? positionTicks, bool isPaused);
  341. /// <summary>
  342. /// Reports to the server that the user has stopped playing an item
  343. /// </summary>
  344. /// <param name="itemId">The item id.</param>
  345. /// <param name="userId">The user id.</param>
  346. /// <param name="positionTicks">The position ticks.</param>
  347. /// <returns>Task{UserItemDataDto}.</returns>
  348. /// <exception cref="ArgumentNullException">itemId</exception>
  349. Task ReportPlaybackStoppedAsync(string itemId, string userId, long? positionTicks);
  350. /// <summary>
  351. /// Instructs antoher client to browse to a library item.
  352. /// </summary>
  353. /// <param name="sessionId">The session id.</param>
  354. /// <param name="itemId">The id of the item to browse to.</param>
  355. /// <param name="itemName">The name of the item to browse to.</param>
  356. /// <param name="itemType">The type of the item to browse to.</param>
  357. /// <param name="context">Optional ui context (movies, music, tv, games, etc). The client is free to ignore this.</param>
  358. /// <returns>Task.</returns>
  359. Task SendBrowseCommandAsync(string sessionId, string itemId, string itemName, string itemType, string context);
  360. /// <summary>
  361. /// Sends the playstate command async.
  362. /// </summary>
  363. /// <param name="sessionId">The session id.</param>
  364. /// <param name="request">The request.</param>
  365. /// <returns>Task.</returns>
  366. Task SendPlaystateCommandAsync(string sessionId, PlaystateRequest request);
  367. /// <summary>
  368. /// Sends the play command async.
  369. /// </summary>
  370. /// <param name="sessionId">The session id.</param>
  371. /// <param name="request">The request.</param>
  372. /// <returns>Task.</returns>
  373. /// <exception cref="ArgumentNullException">
  374. /// sessionId
  375. /// or
  376. /// request
  377. /// </exception>
  378. Task SendPlayCommandAsync(string sessionId, PlayRequest request);
  379. /// <summary>
  380. /// Clears a user's rating for an item
  381. /// </summary>
  382. /// <param name="itemId">The item id.</param>
  383. /// <param name="userId">The user id.</param>
  384. /// <returns>Task{UserItemDataDto}.</returns>
  385. /// <exception cref="ArgumentNullException">itemId</exception>
  386. Task ClearUserItemRatingAsync(string itemId, string userId);
  387. /// <summary>
  388. /// Updates a user's rating for an item, based on likes or dislikes
  389. /// </summary>
  390. /// <param name="itemId">The item id.</param>
  391. /// <param name="userId">The user id.</param>
  392. /// <param name="likes">if set to <c>true</c> [likes].</param>
  393. /// <returns>Task.</returns>
  394. /// <exception cref="ArgumentNullException">itemId</exception>
  395. Task UpdateUserItemRatingAsync(string itemId, string userId, bool likes);
  396. /// <summary>
  397. /// Authenticates a user and returns the result
  398. /// </summary>
  399. /// <param name="username">The username.</param>
  400. /// <param name="sha1Hash">The sha1 hash.</param>
  401. /// <returns>Task.</returns>
  402. /// <exception cref="ArgumentNullException">userId</exception>
  403. Task<AuthenticationResult> AuthenticateUserAsync(string username, byte[] sha1Hash);
  404. /// <summary>
  405. /// Updates the server configuration async.
  406. /// </summary>
  407. /// <param name="configuration">The configuration.</param>
  408. /// <returns>Task.</returns>
  409. /// <exception cref="ArgumentNullException">configuration</exception>
  410. Task UpdateServerConfigurationAsync(ServerConfiguration configuration);
  411. /// <summary>
  412. /// Updates the scheduled task triggers.
  413. /// </summary>
  414. /// <param name="id">The id.</param>
  415. /// <param name="triggers">The triggers.</param>
  416. /// <returns>Task{RequestResult}.</returns>
  417. /// <exception cref="ArgumentNullException">id</exception>
  418. Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers);
  419. /// <summary>
  420. /// Gets the display preferences.
  421. /// </summary>
  422. /// <param name="id">The id.</param>
  423. /// <param name="userId">The user id.</param>
  424. /// <param name="client">The client.</param>
  425. /// <returns>Task{BaseItemDto}.</returns>
  426. Task<DisplayPreferences> GetDisplayPreferencesAsync(string id, string userId, string client);
  427. /// <summary>
  428. /// Updates display preferences for a user
  429. /// </summary>
  430. /// <param name="id">The id.</param>
  431. /// <param name="displayPreferences">The display preferences.</param>
  432. /// <returns>Task{DisplayPreferences}.</returns>
  433. /// <exception cref="System.ArgumentNullException">userId</exception>
  434. Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences, string userId, string client);
  435. /// <summary>
  436. /// Posts a set of data to a url, and deserializes the return stream into T
  437. /// </summary>
  438. /// <typeparam name="T"></typeparam>
  439. /// <param name="url">The URL.</param>
  440. /// <param name="args">The args.</param>
  441. /// <returns>Task{``0}.</returns>
  442. Task<T> PostAsync<T>(string url, Dictionary<string, string> args)
  443. where T : class;
  444. /// <summary>
  445. /// This is a helper around getting a stream from the server that contains serialized data
  446. /// </summary>
  447. /// <param name="url">The URL.</param>
  448. /// <returns>Task{Stream}.</returns>
  449. Task<Stream> GetSerializedStreamAsync(string url);
  450. /// <summary>
  451. /// Gets the json serializer.
  452. /// </summary>
  453. /// <value>The json serializer.</value>
  454. IJsonSerializer JsonSerializer { get; set; }
  455. /// <summary>
  456. /// Gets or sets the server host name (myserver or 192.168.x.x)
  457. /// </summary>
  458. /// <value>The name of the server host.</value>
  459. string ServerHostName { get; set; }
  460. /// <summary>
  461. /// Gets or sets the port number used by the API
  462. /// </summary>
  463. /// <value>The server API port.</value>
  464. int ServerApiPort { get; set; }
  465. /// <summary>
  466. /// Gets or sets the type of the client.
  467. /// </summary>
  468. /// <value>The type of the client.</value>
  469. string ClientName { get; set; }
  470. /// <summary>
  471. /// Gets or sets the name of the device.
  472. /// </summary>
  473. /// <value>The name of the device.</value>
  474. string DeviceName { get; set; }
  475. /// <summary>
  476. /// Gets or sets the device id.
  477. /// </summary>
  478. /// <value>The device id.</value>
  479. string DeviceId { get; set; }
  480. /// <summary>
  481. /// Gets or sets the current user id.
  482. /// </summary>
  483. /// <value>The current user id.</value>
  484. string CurrentUserId { get; set; }
  485. /// <summary>
  486. /// Gets the image URL.
  487. /// </summary>
  488. /// <param name="item">The item.</param>
  489. /// <param name="options">The options.</param>
  490. /// <returns>System.String.</returns>
  491. /// <exception cref="ArgumentNullException">item</exception>
  492. string GetImageUrl(BaseItemDto item, ImageOptions options);
  493. /// <summary>
  494. /// Gets an image url that can be used to download an image from the api
  495. /// </summary>
  496. /// <param name="itemId">The Id of the item</param>
  497. /// <param name="options">The options.</param>
  498. /// <returns>System.String.</returns>
  499. /// <exception cref="ArgumentNullException">itemId</exception>
  500. string GetImageUrl(string itemId, ImageOptions options);
  501. /// <summary>
  502. /// Gets the user image URL.
  503. /// </summary>
  504. /// <param name="user">The user.</param>
  505. /// <param name="options">The options.</param>
  506. /// <returns>System.String.</returns>
  507. /// <exception cref="ArgumentNullException">user</exception>
  508. string GetUserImageUrl(UserDto user, 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="userId">The Id of the user</param>
  513. /// <param name="options">The options.</param>
  514. /// <returns>System.String.</returns>
  515. /// <exception cref="ArgumentNullException">userId</exception>
  516. string GetUserImageUrl(string userId, ImageOptions options);
  517. /// <summary>
  518. /// Gets the person 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 GetPersonImageUrl(BaseItemPerson item, ImageOptions options);
  525. /// <summary>
  526. /// Gets the person image URL.
  527. /// </summary>
  528. /// <param name="item">The item.</param>
  529. /// <param name="options">The options.</param>
  530. /// <returns>System.String.</returns>
  531. /// <exception cref="ArgumentNullException">item</exception>
  532. string GetPersonImageUrl(BaseItemDto item, ImageOptions options);
  533. /// <summary>
  534. /// Gets an image url that can be used to download an image from the api
  535. /// </summary>
  536. /// <param name="name">The name of the person</param>
  537. /// <param name="options">The options.</param>
  538. /// <returns>System.String.</returns>
  539. /// <exception cref="ArgumentNullException">name</exception>
  540. string GetPersonImageUrl(string name, ImageOptions options);
  541. /// <summary>
  542. /// Gets the year image URL.
  543. /// </summary>
  544. /// <param name="item">The item.</param>
  545. /// <param name="options">The options.</param>
  546. /// <returns>System.String.</returns>
  547. /// <exception cref="ArgumentNullException">item</exception>
  548. string GetYearImageUrl(BaseItemDto item, ImageOptions options);
  549. /// <summary>
  550. /// Gets an image url that can be used to download an image from the api
  551. /// </summary>
  552. /// <param name="year">The year.</param>
  553. /// <param name="options">The options.</param>
  554. /// <returns>System.String.</returns>
  555. string GetYearImageUrl(int year, ImageOptions options);
  556. /// <summary>
  557. /// Gets the genre image URL.
  558. /// </summary>
  559. /// <param name="item">The item.</param>
  560. /// <param name="options">The options.</param>
  561. /// <returns>System.String.</returns>
  562. /// <exception cref="ArgumentNullException">item</exception>
  563. string GetGenreImageUrl(BaseItemDto item, ImageOptions options);
  564. /// <summary>
  565. /// Gets an image url that can be used to download an image from the api
  566. /// </summary>
  567. /// <param name="name">The name.</param>
  568. /// <param name="options">The options.</param>
  569. /// <returns>System.String.</returns>
  570. /// <exception cref="ArgumentNullException">name</exception>
  571. string GetGenreImageUrl(string name, ImageOptions options);
  572. /// <summary>
  573. /// Gets the studio image URL.
  574. /// </summary>
  575. /// <param name="item">The item.</param>
  576. /// <param name="options">The options.</param>
  577. /// <returns>System.String.</returns>
  578. /// <exception cref="ArgumentNullException">item</exception>
  579. string GetStudioImageUrl(BaseItemDto item, ImageOptions options);
  580. /// <summary>
  581. /// Gets an image url that can be used to download an image from the api
  582. /// </summary>
  583. /// <param name="name">The name.</param>
  584. /// <param name="options">The options.</param>
  585. /// <returns>System.String.</returns>
  586. /// <exception cref="ArgumentNullException">name</exception>
  587. string GetStudioImageUrl(string name, ImageOptions options);
  588. /// <summary>
  589. /// Gets the artist image URL.
  590. /// </summary>
  591. /// <param name="item">The item.</param>
  592. /// <param name="options">The options.</param>
  593. /// <returns>System.String.</returns>
  594. /// <exception cref="ArgumentNullException">item
  595. /// or
  596. /// options</exception>
  597. string GetArtistImageUrl(BaseItemDto item, ImageOptions options);
  598. /// <summary>
  599. /// Gets the artist image URL.
  600. /// </summary>
  601. /// <param name="name">The name.</param>
  602. /// <param name="options">The options.</param>
  603. /// <returns>System.String.</returns>
  604. /// <exception cref="ArgumentNullException">name</exception>
  605. string GetArtistImageUrl(string name, ImageOptions options);
  606. /// <summary>
  607. /// 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.
  608. /// </summary>
  609. /// <param name="item">A given item.</param>
  610. /// <param name="options">The options.</param>
  611. /// <returns>System.String[][].</returns>
  612. /// <exception cref="ArgumentNullException">item</exception>
  613. string[] GetBackdropImageUrls(BaseItemDto item, ImageOptions options);
  614. /// <summary>
  615. /// 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.
  616. /// </summary>
  617. /// <param name="item">A given item.</param>
  618. /// <param name="options">The options.</param>
  619. /// <returns>System.String.</returns>
  620. /// <exception cref="ArgumentNullException">item</exception>
  621. string GetLogoImageUrl(BaseItemDto item, ImageOptions options);
  622. /// <summary>
  623. /// Gets the art image URL.
  624. /// </summary>
  625. /// <param name="item">The item.</param>
  626. /// <param name="options">The options.</param>
  627. /// <returns>System.String.</returns>
  628. string GetArtImageUrl(BaseItemDto item, ImageOptions options);
  629. /// <summary>
  630. /// Gets the url needed to stream an audio file
  631. /// </summary>
  632. /// <param name="options">The options.</param>
  633. /// <returns>System.String.</returns>
  634. /// <exception cref="ArgumentNullException">options</exception>
  635. string GetAudioStreamUrl(StreamOptions options);
  636. /// <summary>
  637. /// Gets the url needed to stream a video file
  638. /// </summary>
  639. /// <param name="options">The options.</param>
  640. /// <returns>System.String.</returns>
  641. /// <exception cref="ArgumentNullException">options</exception>
  642. string GetVideoStreamUrl(VideoStreamOptions options);
  643. /// <summary>
  644. /// Formulates a url for streaming audio using the HLS protocol
  645. /// </summary>
  646. /// <param name="options">The options.</param>
  647. /// <returns>System.String.</returns>
  648. /// <exception cref="ArgumentNullException">options</exception>
  649. string GetHlsAudioStreamUrl(StreamOptions options);
  650. /// <summary>
  651. /// Formulates a url for streaming video using the HLS protocol
  652. /// </summary>
  653. /// <param name="options">The options.</param>
  654. /// <returns>System.String.</returns>
  655. /// <exception cref="ArgumentNullException">options</exception>
  656. string GetHlsVideoStreamUrl(VideoStreamOptions options);
  657. }
  658. }