IApiClient.cs 26 KB

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