20241112232041_fixMediaStreams.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Jellyfin.Server.Implementations.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class FixMediaStreams : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AlterColumn<int>(
  12. name: "Width",
  13. table: "MediaStreamInfos",
  14. type: "INTEGER",
  15. nullable: true,
  16. oldClrType: typeof(int),
  17. oldType: "INTEGER");
  18. migrationBuilder.AlterColumn<string>(
  19. name: "Title",
  20. table: "MediaStreamInfos",
  21. type: "TEXT",
  22. nullable: true,
  23. oldClrType: typeof(string),
  24. oldType: "TEXT");
  25. migrationBuilder.AlterColumn<string>(
  26. name: "TimeBase",
  27. table: "MediaStreamInfos",
  28. type: "TEXT",
  29. nullable: true,
  30. oldClrType: typeof(string),
  31. oldType: "TEXT");
  32. migrationBuilder.AlterColumn<int>(
  33. name: "StreamType",
  34. table: "MediaStreamInfos",
  35. type: "INTEGER",
  36. nullable: false,
  37. defaultValue: 0,
  38. oldClrType: typeof(int),
  39. oldType: "INTEGER",
  40. oldNullable: true);
  41. migrationBuilder.AlterColumn<int>(
  42. name: "SampleRate",
  43. table: "MediaStreamInfos",
  44. type: "INTEGER",
  45. nullable: true,
  46. oldClrType: typeof(int),
  47. oldType: "INTEGER");
  48. migrationBuilder.AlterColumn<int>(
  49. name: "RpuPresentFlag",
  50. table: "MediaStreamInfos",
  51. type: "INTEGER",
  52. nullable: true,
  53. oldClrType: typeof(int),
  54. oldType: "INTEGER");
  55. migrationBuilder.AlterColumn<int>(
  56. name: "Rotation",
  57. table: "MediaStreamInfos",
  58. type: "INTEGER",
  59. nullable: true,
  60. oldClrType: typeof(int),
  61. oldType: "INTEGER");
  62. migrationBuilder.AlterColumn<int>(
  63. name: "RefFrames",
  64. table: "MediaStreamInfos",
  65. type: "INTEGER",
  66. nullable: true,
  67. oldClrType: typeof(int),
  68. oldType: "INTEGER");
  69. migrationBuilder.AlterColumn<float>(
  70. name: "RealFrameRate",
  71. table: "MediaStreamInfos",
  72. type: "REAL",
  73. nullable: true,
  74. oldClrType: typeof(float),
  75. oldType: "REAL");
  76. migrationBuilder.AlterColumn<string>(
  77. name: "Profile",
  78. table: "MediaStreamInfos",
  79. type: "TEXT",
  80. nullable: false,
  81. defaultValue: string.Empty,
  82. oldClrType: typeof(string),
  83. oldType: "TEXT",
  84. oldNullable: true);
  85. migrationBuilder.AlterColumn<string>(
  86. name: "Path",
  87. table: "MediaStreamInfos",
  88. type: "TEXT",
  89. nullable: false,
  90. defaultValue: string.Empty,
  91. oldClrType: typeof(string),
  92. oldType: "TEXT",
  93. oldNullable: true);
  94. migrationBuilder.AlterColumn<string>(
  95. name: "NalLengthSize",
  96. table: "MediaStreamInfos",
  97. type: "TEXT",
  98. nullable: true,
  99. oldClrType: typeof(string),
  100. oldType: "TEXT");
  101. migrationBuilder.AlterColumn<float>(
  102. name: "Level",
  103. table: "MediaStreamInfos",
  104. type: "REAL",
  105. nullable: true,
  106. oldClrType: typeof(float),
  107. oldType: "REAL");
  108. migrationBuilder.AlterColumn<string>(
  109. name: "Language",
  110. table: "MediaStreamInfos",
  111. type: "TEXT",
  112. nullable: false,
  113. defaultValue: string.Empty,
  114. oldClrType: typeof(string),
  115. oldType: "TEXT",
  116. oldNullable: true);
  117. migrationBuilder.AlterColumn<bool>(
  118. name: "IsHearingImpaired",
  119. table: "MediaStreamInfos",
  120. type: "INTEGER",
  121. nullable: true,
  122. oldClrType: typeof(bool),
  123. oldType: "INTEGER");
  124. migrationBuilder.AlterColumn<bool>(
  125. name: "IsAvc",
  126. table: "MediaStreamInfos",
  127. type: "INTEGER",
  128. nullable: true,
  129. oldClrType: typeof(bool),
  130. oldType: "INTEGER");
  131. migrationBuilder.AlterColumn<bool>(
  132. name: "IsAnamorphic",
  133. table: "MediaStreamInfos",
  134. type: "INTEGER",
  135. nullable: true,
  136. oldClrType: typeof(bool),
  137. oldType: "INTEGER");
  138. migrationBuilder.AlterColumn<int>(
  139. name: "Height",
  140. table: "MediaStreamInfos",
  141. type: "INTEGER",
  142. nullable: true,
  143. oldClrType: typeof(int),
  144. oldType: "INTEGER");
  145. migrationBuilder.AlterColumn<int>(
  146. name: "ElPresentFlag",
  147. table: "MediaStreamInfos",
  148. type: "INTEGER",
  149. nullable: true,
  150. oldClrType: typeof(int),
  151. oldType: "INTEGER");
  152. migrationBuilder.AlterColumn<int>(
  153. name: "DvVersionMinor",
  154. table: "MediaStreamInfos",
  155. type: "INTEGER",
  156. nullable: true,
  157. oldClrType: typeof(int),
  158. oldType: "INTEGER");
  159. migrationBuilder.AlterColumn<int>(
  160. name: "DvVersionMajor",
  161. table: "MediaStreamInfos",
  162. type: "INTEGER",
  163. nullable: true,
  164. oldClrType: typeof(int),
  165. oldType: "INTEGER");
  166. migrationBuilder.AlterColumn<int>(
  167. name: "DvProfile",
  168. table: "MediaStreamInfos",
  169. type: "INTEGER",
  170. nullable: true,
  171. oldClrType: typeof(int),
  172. oldType: "INTEGER");
  173. migrationBuilder.AlterColumn<int>(
  174. name: "DvLevel",
  175. table: "MediaStreamInfos",
  176. type: "INTEGER",
  177. nullable: true,
  178. oldClrType: typeof(int),
  179. oldType: "INTEGER");
  180. migrationBuilder.AlterColumn<int>(
  181. name: "DvBlSignalCompatibilityId",
  182. table: "MediaStreamInfos",
  183. type: "INTEGER",
  184. nullable: true,
  185. oldClrType: typeof(int),
  186. oldType: "INTEGER");
  187. migrationBuilder.AlterColumn<string>(
  188. name: "Comment",
  189. table: "MediaStreamInfos",
  190. type: "TEXT",
  191. nullable: true,
  192. oldClrType: typeof(string),
  193. oldType: "TEXT");
  194. migrationBuilder.AlterColumn<string>(
  195. name: "ColorTransfer",
  196. table: "MediaStreamInfos",
  197. type: "TEXT",
  198. nullable: true,
  199. oldClrType: typeof(string),
  200. oldType: "TEXT");
  201. migrationBuilder.AlterColumn<string>(
  202. name: "ColorSpace",
  203. table: "MediaStreamInfos",
  204. type: "TEXT",
  205. nullable: true,
  206. oldClrType: typeof(string),
  207. oldType: "TEXT");
  208. migrationBuilder.AlterColumn<string>(
  209. name: "ColorPrimaries",
  210. table: "MediaStreamInfos",
  211. type: "TEXT",
  212. nullable: true,
  213. oldClrType: typeof(string),
  214. oldType: "TEXT");
  215. migrationBuilder.AlterColumn<string>(
  216. name: "CodecTimeBase",
  217. table: "MediaStreamInfos",
  218. type: "TEXT",
  219. nullable: true,
  220. oldClrType: typeof(string),
  221. oldType: "TEXT");
  222. migrationBuilder.AlterColumn<string>(
  223. name: "CodecTag",
  224. table: "MediaStreamInfos",
  225. type: "TEXT",
  226. nullable: true,
  227. oldClrType: typeof(string),
  228. oldType: "TEXT");
  229. migrationBuilder.AlterColumn<string>(
  230. name: "Codec",
  231. table: "MediaStreamInfos",
  232. type: "TEXT",
  233. nullable: false,
  234. defaultValue: string.Empty,
  235. oldClrType: typeof(string),
  236. oldType: "TEXT",
  237. oldNullable: true);
  238. migrationBuilder.AlterColumn<int>(
  239. name: "Channels",
  240. table: "MediaStreamInfos",
  241. type: "INTEGER",
  242. nullable: true,
  243. oldClrType: typeof(int),
  244. oldType: "INTEGER");
  245. migrationBuilder.AlterColumn<string>(
  246. name: "ChannelLayout",
  247. table: "MediaStreamInfos",
  248. type: "TEXT",
  249. nullable: false,
  250. defaultValue: string.Empty,
  251. oldClrType: typeof(string),
  252. oldType: "TEXT",
  253. oldNullable: true);
  254. migrationBuilder.AlterColumn<int>(
  255. name: "BlPresentFlag",
  256. table: "MediaStreamInfos",
  257. type: "INTEGER",
  258. nullable: true,
  259. oldClrType: typeof(int),
  260. oldType: "INTEGER");
  261. migrationBuilder.AlterColumn<int>(
  262. name: "BitRate",
  263. table: "MediaStreamInfos",
  264. type: "INTEGER",
  265. nullable: true,
  266. oldClrType: typeof(int),
  267. oldType: "INTEGER");
  268. migrationBuilder.AlterColumn<int>(
  269. name: "BitDepth",
  270. table: "MediaStreamInfos",
  271. type: "INTEGER",
  272. nullable: true,
  273. oldClrType: typeof(int),
  274. oldType: "INTEGER");
  275. migrationBuilder.AlterColumn<float>(
  276. name: "AverageFrameRate",
  277. table: "MediaStreamInfos",
  278. type: "REAL",
  279. nullable: true,
  280. oldClrType: typeof(float),
  281. oldType: "REAL");
  282. migrationBuilder.AlterColumn<string>(
  283. name: "AspectRatio",
  284. table: "MediaStreamInfos",
  285. type: "TEXT",
  286. nullable: false,
  287. defaultValue: string.Empty,
  288. oldClrType: typeof(string),
  289. oldType: "TEXT",
  290. oldNullable: true);
  291. }
  292. /// <inheritdoc />
  293. protected override void Down(MigrationBuilder migrationBuilder)
  294. {
  295. migrationBuilder.AlterColumn<int>(
  296. name: "Width",
  297. table: "MediaStreamInfos",
  298. type: "INTEGER",
  299. nullable: false,
  300. defaultValue: 0,
  301. oldClrType: typeof(int),
  302. oldType: "INTEGER",
  303. oldNullable: true);
  304. migrationBuilder.AlterColumn<string>(
  305. name: "Title",
  306. table: "MediaStreamInfos",
  307. type: "TEXT",
  308. nullable: false,
  309. defaultValue: string.Empty,
  310. oldClrType: typeof(string),
  311. oldType: "TEXT",
  312. oldNullable: true);
  313. migrationBuilder.AlterColumn<string>(
  314. name: "TimeBase",
  315. table: "MediaStreamInfos",
  316. type: "TEXT",
  317. nullable: false,
  318. defaultValue: string.Empty,
  319. oldClrType: typeof(string),
  320. oldType: "TEXT",
  321. oldNullable: true);
  322. migrationBuilder.AlterColumn<int>(
  323. name: "StreamType",
  324. table: "MediaStreamInfos",
  325. type: "INTEGER",
  326. nullable: true,
  327. oldClrType: typeof(int),
  328. oldType: "INTEGER");
  329. migrationBuilder.AlterColumn<int>(
  330. name: "SampleRate",
  331. table: "MediaStreamInfos",
  332. type: "INTEGER",
  333. nullable: false,
  334. defaultValue: 0,
  335. oldClrType: typeof(int),
  336. oldType: "INTEGER",
  337. oldNullable: true);
  338. migrationBuilder.AlterColumn<int>(
  339. name: "RpuPresentFlag",
  340. table: "MediaStreamInfos",
  341. type: "INTEGER",
  342. nullable: false,
  343. defaultValue: 0,
  344. oldClrType: typeof(int),
  345. oldType: "INTEGER",
  346. oldNullable: true);
  347. migrationBuilder.AlterColumn<int>(
  348. name: "Rotation",
  349. table: "MediaStreamInfos",
  350. type: "INTEGER",
  351. nullable: false,
  352. defaultValue: 0,
  353. oldClrType: typeof(int),
  354. oldType: "INTEGER",
  355. oldNullable: true);
  356. migrationBuilder.AlterColumn<int>(
  357. name: "RefFrames",
  358. table: "MediaStreamInfos",
  359. type: "INTEGER",
  360. nullable: false,
  361. defaultValue: 0,
  362. oldClrType: typeof(int),
  363. oldType: "INTEGER",
  364. oldNullable: true);
  365. migrationBuilder.AlterColumn<float>(
  366. name: "RealFrameRate",
  367. table: "MediaStreamInfos",
  368. type: "REAL",
  369. nullable: false,
  370. defaultValue: 0f,
  371. oldClrType: typeof(float),
  372. oldType: "REAL",
  373. oldNullable: true);
  374. migrationBuilder.AlterColumn<string>(
  375. name: "Profile",
  376. table: "MediaStreamInfos",
  377. type: "TEXT",
  378. nullable: true,
  379. oldClrType: typeof(string),
  380. oldType: "TEXT");
  381. migrationBuilder.AlterColumn<string>(
  382. name: "Path",
  383. table: "MediaStreamInfos",
  384. type: "TEXT",
  385. nullable: true,
  386. oldClrType: typeof(string),
  387. oldType: "TEXT");
  388. migrationBuilder.AlterColumn<string>(
  389. name: "NalLengthSize",
  390. table: "MediaStreamInfos",
  391. type: "TEXT",
  392. nullable: false,
  393. defaultValue: string.Empty,
  394. oldClrType: typeof(string),
  395. oldType: "TEXT",
  396. oldNullable: true);
  397. migrationBuilder.AlterColumn<float>(
  398. name: "Level",
  399. table: "MediaStreamInfos",
  400. type: "REAL",
  401. nullable: false,
  402. defaultValue: 0f,
  403. oldClrType: typeof(float),
  404. oldType: "REAL",
  405. oldNullable: true);
  406. migrationBuilder.AlterColumn<string>(
  407. name: "Language",
  408. table: "MediaStreamInfos",
  409. type: "TEXT",
  410. nullable: true,
  411. oldClrType: typeof(string),
  412. oldType: "TEXT");
  413. migrationBuilder.AlterColumn<bool>(
  414. name: "IsHearingImpaired",
  415. table: "MediaStreamInfos",
  416. type: "INTEGER",
  417. nullable: false,
  418. defaultValue: false,
  419. oldClrType: typeof(bool),
  420. oldType: "INTEGER",
  421. oldNullable: true);
  422. migrationBuilder.AlterColumn<bool>(
  423. name: "IsAvc",
  424. table: "MediaStreamInfos",
  425. type: "INTEGER",
  426. nullable: false,
  427. defaultValue: false,
  428. oldClrType: typeof(bool),
  429. oldType: "INTEGER",
  430. oldNullable: true);
  431. migrationBuilder.AlterColumn<bool>(
  432. name: "IsAnamorphic",
  433. table: "MediaStreamInfos",
  434. type: "INTEGER",
  435. nullable: false,
  436. defaultValue: false,
  437. oldClrType: typeof(bool),
  438. oldType: "INTEGER",
  439. oldNullable: true);
  440. migrationBuilder.AlterColumn<int>(
  441. name: "Height",
  442. table: "MediaStreamInfos",
  443. type: "INTEGER",
  444. nullable: false,
  445. defaultValue: 0,
  446. oldClrType: typeof(int),
  447. oldType: "INTEGER",
  448. oldNullable: true);
  449. migrationBuilder.AlterColumn<int>(
  450. name: "ElPresentFlag",
  451. table: "MediaStreamInfos",
  452. type: "INTEGER",
  453. nullable: false,
  454. defaultValue: 0,
  455. oldClrType: typeof(int),
  456. oldType: "INTEGER",
  457. oldNullable: true);
  458. migrationBuilder.AlterColumn<int>(
  459. name: "DvVersionMinor",
  460. table: "MediaStreamInfos",
  461. type: "INTEGER",
  462. nullable: false,
  463. defaultValue: 0,
  464. oldClrType: typeof(int),
  465. oldType: "INTEGER",
  466. oldNullable: true);
  467. migrationBuilder.AlterColumn<int>(
  468. name: "DvVersionMajor",
  469. table: "MediaStreamInfos",
  470. type: "INTEGER",
  471. nullable: false,
  472. defaultValue: 0,
  473. oldClrType: typeof(int),
  474. oldType: "INTEGER",
  475. oldNullable: true);
  476. migrationBuilder.AlterColumn<int>(
  477. name: "DvProfile",
  478. table: "MediaStreamInfos",
  479. type: "INTEGER",
  480. nullable: false,
  481. defaultValue: 0,
  482. oldClrType: typeof(int),
  483. oldType: "INTEGER",
  484. oldNullable: true);
  485. migrationBuilder.AlterColumn<int>(
  486. name: "DvLevel",
  487. table: "MediaStreamInfos",
  488. type: "INTEGER",
  489. nullable: false,
  490. defaultValue: 0,
  491. oldClrType: typeof(int),
  492. oldType: "INTEGER",
  493. oldNullable: true);
  494. migrationBuilder.AlterColumn<int>(
  495. name: "DvBlSignalCompatibilityId",
  496. table: "MediaStreamInfos",
  497. type: "INTEGER",
  498. nullable: false,
  499. defaultValue: 0,
  500. oldClrType: typeof(int),
  501. oldType: "INTEGER",
  502. oldNullable: true);
  503. migrationBuilder.AlterColumn<string>(
  504. name: "Comment",
  505. table: "MediaStreamInfos",
  506. type: "TEXT",
  507. nullable: false,
  508. defaultValue: string.Empty,
  509. oldClrType: typeof(string),
  510. oldType: "TEXT",
  511. oldNullable: true);
  512. migrationBuilder.AlterColumn<string>(
  513. name: "ColorTransfer",
  514. table: "MediaStreamInfos",
  515. type: "TEXT",
  516. nullable: false,
  517. defaultValue: string.Empty,
  518. oldClrType: typeof(string),
  519. oldType: "TEXT",
  520. oldNullable: true);
  521. migrationBuilder.AlterColumn<string>(
  522. name: "ColorSpace",
  523. table: "MediaStreamInfos",
  524. type: "TEXT",
  525. nullable: false,
  526. defaultValue: string.Empty,
  527. oldClrType: typeof(string),
  528. oldType: "TEXT",
  529. oldNullable: true);
  530. migrationBuilder.AlterColumn<string>(
  531. name: "ColorPrimaries",
  532. table: "MediaStreamInfos",
  533. type: "TEXT",
  534. nullable: false,
  535. defaultValue: string.Empty,
  536. oldClrType: typeof(string),
  537. oldType: "TEXT",
  538. oldNullable: true);
  539. migrationBuilder.AlterColumn<string>(
  540. name: "CodecTimeBase",
  541. table: "MediaStreamInfos",
  542. type: "TEXT",
  543. nullable: false,
  544. defaultValue: string.Empty,
  545. oldClrType: typeof(string),
  546. oldType: "TEXT",
  547. oldNullable: true);
  548. migrationBuilder.AlterColumn<string>(
  549. name: "CodecTag",
  550. table: "MediaStreamInfos",
  551. type: "TEXT",
  552. nullable: false,
  553. defaultValue: string.Empty,
  554. oldClrType: typeof(string),
  555. oldType: "TEXT",
  556. oldNullable: true);
  557. migrationBuilder.AlterColumn<string>(
  558. name: "Codec",
  559. table: "MediaStreamInfos",
  560. type: "TEXT",
  561. nullable: true,
  562. oldClrType: typeof(string),
  563. oldType: "TEXT");
  564. migrationBuilder.AlterColumn<int>(
  565. name: "Channels",
  566. table: "MediaStreamInfos",
  567. type: "INTEGER",
  568. nullable: false,
  569. defaultValue: 0,
  570. oldClrType: typeof(int),
  571. oldType: "INTEGER",
  572. oldNullable: true);
  573. migrationBuilder.AlterColumn<string>(
  574. name: "ChannelLayout",
  575. table: "MediaStreamInfos",
  576. type: "TEXT",
  577. nullable: true,
  578. oldClrType: typeof(string),
  579. oldType: "TEXT");
  580. migrationBuilder.AlterColumn<int>(
  581. name: "BlPresentFlag",
  582. table: "MediaStreamInfos",
  583. type: "INTEGER",
  584. nullable: false,
  585. defaultValue: 0,
  586. oldClrType: typeof(int),
  587. oldType: "INTEGER",
  588. oldNullable: true);
  589. migrationBuilder.AlterColumn<int>(
  590. name: "BitRate",
  591. table: "MediaStreamInfos",
  592. type: "INTEGER",
  593. nullable: false,
  594. defaultValue: 0,
  595. oldClrType: typeof(int),
  596. oldType: "INTEGER",
  597. oldNullable: true);
  598. migrationBuilder.AlterColumn<int>(
  599. name: "BitDepth",
  600. table: "MediaStreamInfos",
  601. type: "INTEGER",
  602. nullable: false,
  603. defaultValue: 0,
  604. oldClrType: typeof(int),
  605. oldType: "INTEGER",
  606. oldNullable: true);
  607. migrationBuilder.AlterColumn<float>(
  608. name: "AverageFrameRate",
  609. table: "MediaStreamInfos",
  610. type: "REAL",
  611. nullable: false,
  612. defaultValue: 0f,
  613. oldClrType: typeof(float),
  614. oldType: "REAL",
  615. oldNullable: true);
  616. migrationBuilder.AlterColumn<string>(
  617. name: "AspectRatio",
  618. table: "MediaStreamInfos",
  619. type: "TEXT",
  620. nullable: true,
  621. oldClrType: typeof(string),
  622. oldType: "TEXT");
  623. }
  624. }
  625. }