IApiClient.cs 26 KB

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