IApiClient.cs 30 KB

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