IApiClient.cs 31 KB

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