Advertisement
Guest User

User KODI - SQL Setup 1.2

a guest
Jan 15th, 2015
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 63.87 KB | None | 0 0
  1. RENAME TABLE `a90`.`files` to `a90`.`globalfiles`;
  2.  
  3. ALTER TABLE `a90`.`globalfiles` CHANGE playCount PlayCount1 INT;
  4. ALTER TABLE `a90`.`globalfiles` CHANGE lastPlayed lastPlayed1 TEXT;
  5. ALTER TABLE `a90`.`globalfiles` ADD playCount2 INT(11) AFTER lastPlayed1;
  6. ALTER TABLE `a90`.`globalfiles` ADD lastPlayed2 TEXT AFTER playCount2;
  7. ALTER TABLE `a90`.`globalfiles` ADD playCount3 INT(11) AFTER lastPlayed2;
  8. ALTER TABLE `a90`.`globalfiles` ADD lastPlayed3 TEXT AFTER playCount3;
  9. ALTER TABLE `a90`.`globalfiles` ADD playCount4 INT(11) AFTER lastPlayed3;
  10. ALTER TABLE `a90`.`globalfiles` ADD lastPlayed4 TEXT AFTER playCount4;
  11. ALTER TABLE `a90`.`globalfiles` ADD playCount5 INT(11) AFTER lastPlayed4;
  12. ALTER TABLE `a90`.`globalfiles` ADD lastPlayed5 TEXT AFTER playCount5;
  13.  
  14. CREATE VIEW `a90`.`files`
  15. AS SELECT
  16. `a90`.`globalfiles`.`idFile` AS `idFile`,
  17. `a90`.`globalfiles`.`idPath` AS `idPath`,
  18. `a90`.`globalfiles`.`strFilename` AS `strFilename`,
  19. `a90`.`globalfiles`.`playCount1` AS `playCount`,
  20. `a90`.`globalfiles`.`lastPlayed1` AS `lastPlayed`,
  21. `a90`.`globalfiles`.`dateAdded` AS `dateAdded`
  22. FROM `a90`.`globalfiles`;
  23.  
  24. CREATE DATABASE b90;
  25.  
  26. CREATE VIEW `b90`.`actorlinkepisode` AS SELECT * FROM `a90`.`actorlinkepisode`;
  27. CREATE VIEW `b90`.`actorlinkmovie` AS SELECT * FROM `a90`.`actorlinkmovie`;
  28. CREATE VIEW `b90`.`actorlinktvshow` AS SELECT * FROM `a90`.`actorlinktvshow`;
  29. CREATE VIEW `b90`.`actors` AS SELECT * FROM `a90`.`actors`;
  30. CREATE VIEW `b90`.`art` AS SELECT * FROM `a90`.`art`;
  31. CREATE VIEW `b90`.`artistlinkmusicvideo` AS SELECT * FROM `a90`.`artistlinkmusicvideo`;
  32. CREATE VIEW `b90`.`country` AS SELECT * FROM `a90`.`country`;
  33. CREATE VIEW `b90`.`countrylinkmovie` AS SELECT * FROM `a90`.`countrylinkmovie`;
  34. CREATE VIEW `b90`.`directorlinkepisode` AS SELECT * FROM `a90`.`directorlinkepisode`;
  35. CREATE VIEW `b90`.`directorlinkmovie` AS SELECT * FROM `a90`.`directorlinkmovie`;
  36. CREATE VIEW `b90`.`directorlinkmusicvideo` AS SELECT * FROM `a90`.`directorlinkmusicvideo`;
  37. CREATE VIEW `b90`.`directorlinktvshow` AS SELECT * FROM `a90`.`directorlinktvshow`;
  38. CREATE VIEW `b90`.`episode` AS SELECT * FROM `a90`.`episode`;
  39. CREATE VIEW `b90`.`genre` AS SELECT * FROM `a90`.`genre`;
  40. CREATE VIEW `b90`.`genrelinkmovie` AS SELECT * FROM `a90`.`genrelinkmovie`;
  41. CREATE VIEW `b90`.`genrelinkmusicvideo` AS SELECT * FROM `a90`.`genrelinkmusicvideo`;
  42. CREATE VIEW `b90`.`genrelinktvshow` AS SELECT * FROM `a90`.`genrelinktvshow`;
  43. CREATE VIEW `b90`.`movie` AS SELECT * FROM `a90`.`movie`;
  44. CREATE VIEW `b90`.`movielinktvshow` AS SELECT * FROM `a90`.`movielinktvshow`;
  45. CREATE VIEW `b90`.`musicvideo` AS SELECT * FROM `a90`.`musicvideo`;
  46. CREATE VIEW `b90`.`path` AS SELECT * FROM `a90`.`path`;
  47. CREATE VIEW `b90`.`seasons` AS SELECT * FROM `a90`.`seasons`;
  48. CREATE VIEW `b90`.`sets` AS SELECT * FROM `a90`.`sets`;
  49. CREATE VIEW `b90`.`settings` AS SELECT * FROM `a90`.`settings`;
  50. CREATE VIEW `b90`.`stacktimes` AS SELECT * FROM `a90`.`stacktimes`;
  51. CREATE VIEW `b90`.`streamdetails` AS SELECT * FROM `a90`.`streamdetails`;
  52. CREATE VIEW `b90`.`studio` AS SELECT * FROM `a90`.`studio`;
  53. CREATE VIEW `b90`.`studiolinkmovie` AS SELECT * FROM `a90`.`studiolinkmovie`;
  54. CREATE VIEW `b90`.`studiolinkmusicvideo` AS SELECT * FROM `a90`.`studiolinkmusicvideo`;
  55. CREATE VIEW `b90`.`studiolinktvshow` AS SELECT * FROM `a90`.`studiolinktvshow`;
  56. CREATE VIEW `b90`.`tag` AS SELECT * FROM `a90`.`tag`;
  57. CREATE VIEW `b90`.`taglinks` AS SELECT * FROM `a90`.`taglinks`;
  58. CREATE VIEW `b90`.`tvshow` AS SELECT * FROM `a90`.`tvshow`;
  59. CREATE VIEW `b90`.`tvshowlinkpath` AS SELECT * FROM `a90`.`tvshowlinkpath`;
  60. CREATE VIEW `b90`.`version` AS SELECT * FROM `a90`.`version`;
  61. CREATE VIEW `b90`.`writerlinkepisode` AS SELECT * FROM `a90`.`writerlinkepisode`;
  62. CREATE VIEW `b90`.`writerlinkmovie` AS SELECT * FROM `a90`.`writerlinkmovie`;
  63.  
  64. CREATE VIEW `b90`.`files`
  65. AS SELECT
  66. `a90`.`globalfiles`.`idFile` AS `idFile`,
  67. `a90`.`globalfiles`.`idPath` AS `idPath`,
  68. `a90`.`globalfiles`.`strFilename` AS `strFilename`,
  69. `a90`.`globalfiles`.`playCount2` AS `playCount`,
  70. `a90`.`globalfiles`.`lastPlayed2` AS `lastPlayed`,
  71. `a90`.`globalfiles`.`dateAdded` AS `dateAdded`
  72. FROM `a90`.`globalfiles`;
  73.  
  74. CREATE TABLE `b90`.`bookmark` (
  75. `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
  76. `idFile` int(11) DEFAULT NULL,
  77. `timeInSeconds` double DEFAULT NULL,
  78. `totalTimeInSeconds` double DEFAULT NULL,
  79. `thumbNailImage` text,
  80. `player` text,
  81. `playerState` text,
  82. `type` int(11) DEFAULT NULL,
  83. PRIMARY KEY (`idBookmark`),
  84. KEY `ix_bookmark` (`idFile`,`type`)
  85. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  86.  
  87. CREATE VIEW `b90`.`episodeview`
  88. AS SELECT
  89. `episode`.`idEpisode` AS `idEpisode`,
  90. `episode`.`idFile` AS `idFile`,
  91. `episode`.`c00` AS `c00`,
  92. `episode`.`c01` AS `c01`,
  93. `episode`.`c02` AS `c02`,
  94. `episode`.`c03` AS `c03`,
  95. `episode`.`c04` AS `c04`,
  96. `episode`.`c05` AS `c05`,
  97. `episode`.`c06` AS `c06`,
  98. `episode`.`c07` AS `c07`,
  99. `episode`.`c08` AS `c08`,
  100. `episode`.`c09` AS `c09`,
  101. `episode`.`c10` AS `c10`,
  102. `episode`.`c11` AS `c11`,
  103. `episode`.`c12` AS `c12`,
  104. `episode`.`c13` AS `c13`,
  105. `episode`.`c14` AS `c14`,
  106. `episode`.`c15` AS `c15`,
  107. `episode`.`c16` AS `c16`,
  108. `episode`.`c17` AS `c17`,
  109. `episode`.`c18` AS `c18`,
  110. `episode`.`c19` AS `c19`,
  111. `episode`.`c20` AS `c20`,
  112. `episode`.`c21` AS `c21`,
  113. `episode`.`c22` AS `c22`,
  114. `episode`.`c23` AS `c23`,
  115. `episode`.`idShow` AS `idShow`,
  116. `files`.`strFilename` AS `strFileName`,
  117. `path`.`strPath` AS `strPath`,
  118. `files`.`playCount` AS `playCount`,
  119. `files`.`lastPlayed` AS `lastPlayed`,
  120. `files`.`dateAdded` AS `dateAdded`,
  121. `tvshow`.`c00` AS `strTitle`,
  122. `tvshow`.`c14` AS `strStudio`,
  123. `tvshow`.`c05` AS `premiered`,
  124. `tvshow`.`c13` AS `mpaa`,
  125. `tvshow`.`c16` AS `strShowPath`,
  126. `b90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  127. `b90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  128. `seasons`.`idSeason` AS `idSeason`
  129. FROM (((((`b90`.`episode` join `b90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `b90`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `b90`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `b90`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `b90`.`bookmark` on(((`b90`.`bookmark`.`idFile` = `episode`.`idFile`) and (`b90`.`bookmark`.`type` = 1))));
  130.  
  131. CREATE VIEW `b90`.`movieview`
  132. AS SELECT
  133. `movie`.`idMovie` AS `idMovie`,
  134. `movie`.`idFile` AS `idFile`,
  135. `movie`.`c00` AS `c00`,
  136. `movie`.`c01` AS `c01`,
  137. `movie`.`c02` AS `c02`,
  138. `movie`.`c03` AS `c03`,
  139. `movie`.`c04` AS `c04`,
  140. `movie`.`c05` AS `c05`,
  141. `movie`.`c06` AS `c06`,
  142. `movie`.`c07` AS `c07`,
  143. `movie`.`c08` AS `c08`,
  144. `movie`.`c09` AS `c09`,
  145. `movie`.`c10` AS `c10`,
  146. `movie`.`c11` AS `c11`,
  147. `movie`.`c12` AS `c12`,
  148. `movie`.`c13` AS `c13`,
  149. `movie`.`c14` AS `c14`,
  150. `movie`.`c15` AS `c15`,
  151. `movie`.`c16` AS `c16`,
  152. `movie`.`c17` AS `c17`,
  153. `movie`.`c18` AS `c18`,
  154. `movie`.`c19` AS `c19`,
  155. `movie`.`c20` AS `c20`,
  156. `movie`.`c21` AS `c21`,
  157. `movie`.`c22` AS `c22`,
  158. `movie`.`c23` AS `c23`,
  159. `movie`.`idSet` AS `idSet`,
  160. `sets`.`strSet` AS `strSet`,
  161. `files`.`strFilename` AS `strFileName`,
  162. `path`.`strPath` AS `strPath`,
  163. `files`.`playCount` AS `playCount`,
  164. `files`.`lastPlayed` AS `lastPlayed`,
  165. `files`.`dateAdded` AS `dateAdded`,
  166. `b90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  167. `b90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  168. FROM ((((`b90`.`movie` left join `b90`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `b90`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `b90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `b90`.`bookmark` on(((`b90`.`bookmark`.`idFile` = `movie`.`idFile`) and (`b90`.`bookmark`.`type` = 1))));
  169.  
  170. CREATE VIEW `b90`.`musicvideoview`
  171. AS SELECT
  172. `musicvideo`.`idMVideo` AS `idMVideo`,
  173. `musicvideo`.`idFile` AS `idFile`,
  174. `musicvideo`.`c00` AS `c00`,
  175. `musicvideo`.`c01` AS `c01`,
  176. `musicvideo`.`c02` AS `c02`,
  177. `musicvideo`.`c03` AS `c03`,
  178. `musicvideo`.`c04` AS `c04`,
  179. `musicvideo`.`c05` AS `c05`,
  180. `musicvideo`.`c06` AS `c06`,
  181. `musicvideo`.`c07` AS `c07`,
  182. `musicvideo`.`c08` AS `c08`,
  183. `musicvideo`.`c09` AS `c09`,
  184. `musicvideo`.`c10` AS `c10`,
  185. `musicvideo`.`c11` AS `c11`,
  186. `musicvideo`.`c12` AS `c12`,
  187. `musicvideo`.`c13` AS `c13`,
  188. `musicvideo`.`c14` AS `c14`,
  189. `musicvideo`.`c15` AS `c15`,
  190. `musicvideo`.`c16` AS `c16`,
  191. `musicvideo`.`c17` AS `c17`,
  192. `musicvideo`.`c18` AS `c18`,
  193. `musicvideo`.`c19` AS `c19`,
  194. `musicvideo`.`c20` AS `c20`,
  195. `musicvideo`.`c21` AS `c21`,
  196. `musicvideo`.`c22` AS `c22`,
  197. `musicvideo`.`c23` AS `c23`,
  198. `files`.`strFilename` AS `strFileName`,
  199. `path`.`strPath` AS `strPath`,
  200. `files`.`playCount` AS `playCount`,
  201. `files`.`lastPlayed` AS `lastPlayed`,
  202. `files`.`dateAdded` AS `dateAdded`,
  203. `b90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  204. `b90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  205. FROM (((`b90`.`musicvideo` join `b90`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `b90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `b90`.`bookmark` on(((`b90`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`b90`.`bookmark`.`type` = 1))));
  206.  
  207. CREATE VIEW `b90`.`tvshowview`
  208. AS SELECT
  209. `tvshow`.`idShow` AS `idShow`,
  210. `tvshow`.`c00` AS `c00`,
  211. `tvshow`.`c01` AS `c01`,
  212. `tvshow`.`c02` AS `c02`,
  213. `tvshow`.`c03` AS `c03`,
  214. `tvshow`.`c04` AS `c04`,
  215. `tvshow`.`c05` AS `c05`,
  216. `tvshow`.`c06` AS `c06`,
  217. `tvshow`.`c07` AS `c07`,
  218. `tvshow`.`c08` AS `c08`,
  219. `tvshow`.`c09` AS `c09`,
  220. `tvshow`.`c10` AS `c10`,
  221. `tvshow`.`c11` AS `c11`,
  222. `tvshow`.`c12` AS `c12`,
  223. `tvshow`.`c13` AS `c13`,
  224. `tvshow`.`c14` AS `c14`,
  225. `tvshow`.`c15` AS `c15`,
  226. `tvshow`.`c16` AS `c16`,
  227. `tvshow`.`c17` AS `c17`,
  228. `tvshow`.`c18` AS `c18`,
  229. `tvshow`.`c19` AS `c19`,
  230. `tvshow`.`c20` AS `c20`,
  231. `tvshow`.`c21` AS `c21`,
  232. `tvshow`.`c22` AS `c22`,
  233. `tvshow`.`c23` AS `c23`,
  234. `path`.`strPath` AS `strPath`,
  235. `path`.`dateAdded` AS `dateAdded`,max(`files`.`lastPlayed`) AS `lastPlayed`,nullif(count(`episode`.`c12`),0) AS `totalCount`,count(`files`.`playCount`) AS `watchedcount`,nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`
  236. FROM ((((`b90`.`tvshow` left join `b90`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `b90`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `b90`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `b90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  237.  
  238. CREATE DATABASE c90;
  239.  
  240. CREATE VIEW `c90`.`actorlinkepisode` AS SELECT * FROM `a90`.`actorlinkepisode`;
  241. CREATE VIEW `c90`.`actorlinkmovie` AS SELECT * FROM `a90`.`actorlinkmovie`;
  242. CREATE VIEW `c90`.`actorlinktvshow` AS SELECT * FROM `a90`.`actorlinktvshow`;
  243. CREATE VIEW `c90`.`actors` AS SELECT * FROM `a90`.`actors`;
  244. CREATE VIEW `c90`.`art` AS SELECT * FROM `a90`.`art`;
  245. CREATE VIEW `c90`.`artistlinkmusicvideo` AS SELECT * FROM `a90`.`artistlinkmusicvideo`;
  246. CREATE VIEW `c90`.`country` AS SELECT * FROM `a90`.`country`;
  247. CREATE VIEW `c90`.`countrylinkmovie` AS SELECT * FROM `a90`.`countrylinkmovie`;
  248. CREATE VIEW `c90`.`directorlinkepisode` AS SELECT * FROM `a90`.`directorlinkepisode`;
  249. CREATE VIEW `c90`.`directorlinkmovie` AS SELECT * FROM `a90`.`directorlinkmovie`;
  250. CREATE VIEW `c90`.`directorlinkmusicvideo` AS SELECT * FROM `a90`.`directorlinkmusicvideo`;
  251. CREATE VIEW `c90`.`directorlinktvshow` AS SELECT * FROM `a90`.`directorlinktvshow`;
  252. CREATE VIEW `c90`.`episode` AS SELECT * FROM `a90`.`episode`;
  253. CREATE VIEW `c90`.`genre` AS SELECT * FROM `a90`.`genre`;
  254. CREATE VIEW `c90`.`genrelinkmovie` AS SELECT * FROM `a90`.`genrelinkmovie`;
  255. CREATE VIEW `c90`.`genrelinkmusicvideo` AS SELECT * FROM `a90`.`genrelinkmusicvideo`;
  256. CREATE VIEW `c90`.`genrelinktvshow` AS SELECT * FROM `a90`.`genrelinktvshow`;
  257. CREATE VIEW `c90`.`movie` AS SELECT * FROM `a90`.`movie`;
  258. CREATE VIEW `c90`.`movielinktvshow` AS SELECT * FROM `a90`.`movielinktvshow`;
  259. CREATE VIEW `c90`.`musicvideo` AS SELECT * FROM `a90`.`musicvideo`;
  260. CREATE VIEW `c90`.`path` AS SELECT * FROM `a90`.`path`;
  261. CREATE VIEW `c90`.`seasons` AS SELECT * FROM `a90`.`seasons`;
  262. CREATE VIEW `c90`.`sets` AS SELECT * FROM `a90`.`sets`;
  263. CREATE VIEW `c90`.`settings` AS SELECT * FROM `a90`.`settings`;
  264. CREATE VIEW `c90`.`stacktimes` AS SELECT * FROM `a90`.`stacktimes`;
  265. CREATE VIEW `c90`.`streamdetails` AS SELECT * FROM `a90`.`streamdetails`;
  266. CREATE VIEW `c90`.`studio` AS SELECT * FROM `a90`.`studio`;
  267. CREATE VIEW `c90`.`studiolinkmovie` AS SELECT * FROM `a90`.`studiolinkmovie`;
  268. CREATE VIEW `c90`.`studiolinkmusicvideo` AS SELECT * FROM `a90`.`studiolinkmusicvideo`;
  269. CREATE VIEW `c90`.`studiolinktvshow` AS SELECT * FROM `a90`.`studiolinktvshow`;
  270. CREATE VIEW `c90`.`tag` AS SELECT * FROM `a90`.`tag`;
  271. CREATE VIEW `c90`.`taglinks` AS SELECT * FROM `a90`.`taglinks`;
  272. CREATE VIEW `c90`.`tvshow` AS SELECT * FROM `a90`.`tvshow`;
  273. CREATE VIEW `c90`.`tvshowlinkpath` AS SELECT * FROM `a90`.`tvshowlinkpath`;
  274. CREATE VIEW `c90`.`version` AS SELECT * FROM `a90`.`version`;
  275. CREATE VIEW `c90`.`writerlinkepisode` AS SELECT * FROM `a90`.`writerlinkepisode`;
  276. CREATE VIEW `c90`.`writerlinkmovie` AS SELECT * FROM `a90`.`writerlinkmovie`;
  277.  
  278. CREATE VIEW `c90`.`files`
  279. AS SELECT
  280. `a90`.`globalfiles`.`idFile` AS `idFile`,
  281. `a90`.`globalfiles`.`idPath` AS `idPath`,
  282. `a90`.`globalfiles`.`strFilename` AS `strFilename`,
  283. `a90`.`globalfiles`.`playCount3` AS `playCount`,
  284. `a90`.`globalfiles`.`lastPlayed3` AS `lastPlayed`,
  285. `a90`.`globalfiles`.`dateAdded` AS `dateAdded`
  286. FROM `a90`.`globalfiles`;
  287.  
  288. CREATE TABLE `c90`.`bookmark` (
  289. `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
  290. `idFile` int(11) DEFAULT NULL,
  291. `timeInSeconds` double DEFAULT NULL,
  292. `totalTimeInSeconds` double DEFAULT NULL,
  293. `thumbNailImage` text,
  294. `player` text,
  295. `playerState` text,
  296. `type` int(11) DEFAULT NULL,
  297. PRIMARY KEY (`idBookmark`),
  298. KEY `ix_bookmark` (`idFile`,`type`)
  299. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  300.  
  301. CREATE VIEW `c90`.`episodeview`
  302. AS SELECT
  303. `episode`.`idEpisode` AS `idEpisode`,
  304. `episode`.`idFile` AS `idFile`,
  305. `episode`.`c00` AS `c00`,
  306. `episode`.`c01` AS `c01`,
  307. `episode`.`c02` AS `c02`,
  308. `episode`.`c03` AS `c03`,
  309. `episode`.`c04` AS `c04`,
  310. `episode`.`c05` AS `c05`,
  311. `episode`.`c06` AS `c06`,
  312. `episode`.`c07` AS `c07`,
  313. `episode`.`c08` AS `c08`,
  314. `episode`.`c09` AS `c09`,
  315. `episode`.`c10` AS `c10`,
  316. `episode`.`c11` AS `c11`,
  317. `episode`.`c12` AS `c12`,
  318. `episode`.`c13` AS `c13`,
  319. `episode`.`c14` AS `c14`,
  320. `episode`.`c15` AS `c15`,
  321. `episode`.`c16` AS `c16`,
  322. `episode`.`c17` AS `c17`,
  323. `episode`.`c18` AS `c18`,
  324. `episode`.`c19` AS `c19`,
  325. `episode`.`c20` AS `c20`,
  326. `episode`.`c21` AS `c21`,
  327. `episode`.`c22` AS `c22`,
  328. `episode`.`c23` AS `c23`,
  329. `episode`.`idShow` AS `idShow`,
  330. `files`.`strFilename` AS `strFileName`,
  331. `path`.`strPath` AS `strPath`,
  332. `files`.`playCount` AS `playCount`,
  333. `files`.`lastPlayed` AS `lastPlayed`,
  334. `files`.`dateAdded` AS `dateAdded`,
  335. `tvshow`.`c00` AS `strTitle`,
  336. `tvshow`.`c14` AS `strStudio`,
  337. `tvshow`.`c05` AS `premiered`,
  338. `tvshow`.`c13` AS `mpaa`,
  339. `tvshow`.`c16` AS `strShowPath`,
  340. `c90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  341. `c90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  342. `seasons`.`idSeason` AS `idSeason`
  343. FROM (((((`c90`.`episode` join `c90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `c90`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `c90`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `c90`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `c90`.`bookmark` on(((`c90`.`bookmark`.`idFile` = `episode`.`idFile`) and (`c90`.`bookmark`.`type` = 1))));
  344.  
  345. CREATE VIEW `c90`.`movieview`
  346. AS SELECT
  347. `movie`.`idMovie` AS `idMovie`,
  348. `movie`.`idFile` AS `idFile`,
  349. `movie`.`c00` AS `c00`,
  350. `movie`.`c01` AS `c01`,
  351. `movie`.`c02` AS `c02`,
  352. `movie`.`c03` AS `c03`,
  353. `movie`.`c04` AS `c04`,
  354. `movie`.`c05` AS `c05`,
  355. `movie`.`c06` AS `c06`,
  356. `movie`.`c07` AS `c07`,
  357. `movie`.`c08` AS `c08`,
  358. `movie`.`c09` AS `c09`,
  359. `movie`.`c10` AS `c10`,
  360. `movie`.`c11` AS `c11`,
  361. `movie`.`c12` AS `c12`,
  362. `movie`.`c13` AS `c13`,
  363. `movie`.`c14` AS `c14`,
  364. `movie`.`c15` AS `c15`,
  365. `movie`.`c16` AS `c16`,
  366. `movie`.`c17` AS `c17`,
  367. `movie`.`c18` AS `c18`,
  368. `movie`.`c19` AS `c19`,
  369. `movie`.`c20` AS `c20`,
  370. `movie`.`c21` AS `c21`,
  371. `movie`.`c22` AS `c22`,
  372. `movie`.`c23` AS `c23`,
  373. `movie`.`idSet` AS `idSet`,
  374. `sets`.`strSet` AS `strSet`,
  375. `files`.`strFilename` AS `strFileName`,
  376. `path`.`strPath` AS `strPath`,
  377. `files`.`playCount` AS `playCount`,
  378. `files`.`lastPlayed` AS `lastPlayed`,
  379. `files`.`dateAdded` AS `dateAdded`,
  380. `c90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  381. `c90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  382. FROM ((((`c90`.`movie` left join `c90`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `c90`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `c90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `c90`.`bookmark` on(((`c90`.`bookmark`.`idFile` = `movie`.`idFile`) and (`c90`.`bookmark`.`type` = 1))));
  383.  
  384. CREATE VIEW `c90`.`musicvideoview`
  385. AS SELECT
  386. `musicvideo`.`idMVideo` AS `idMVideo`,
  387. `musicvideo`.`idFile` AS `idFile`,
  388. `musicvideo`.`c00` AS `c00`,
  389. `musicvideo`.`c01` AS `c01`,
  390. `musicvideo`.`c02` AS `c02`,
  391. `musicvideo`.`c03` AS `c03`,
  392. `musicvideo`.`c04` AS `c04`,
  393. `musicvideo`.`c05` AS `c05`,
  394. `musicvideo`.`c06` AS `c06`,
  395. `musicvideo`.`c07` AS `c07`,
  396. `musicvideo`.`c08` AS `c08`,
  397. `musicvideo`.`c09` AS `c09`,
  398. `musicvideo`.`c10` AS `c10`,
  399. `musicvideo`.`c11` AS `c11`,
  400. `musicvideo`.`c12` AS `c12`,
  401. `musicvideo`.`c13` AS `c13`,
  402. `musicvideo`.`c14` AS `c14`,
  403. `musicvideo`.`c15` AS `c15`,
  404. `musicvideo`.`c16` AS `c16`,
  405. `musicvideo`.`c17` AS `c17`,
  406. `musicvideo`.`c18` AS `c18`,
  407. `musicvideo`.`c19` AS `c19`,
  408. `musicvideo`.`c20` AS `c20`,
  409. `musicvideo`.`c21` AS `c21`,
  410. `musicvideo`.`c22` AS `c22`,
  411. `musicvideo`.`c23` AS `c23`,
  412. `files`.`strFilename` AS `strFileName`,
  413. `path`.`strPath` AS `strPath`,
  414. `files`.`playCount` AS `playCount`,
  415. `files`.`lastPlayed` AS `lastPlayed`,
  416. `files`.`dateAdded` AS `dateAdded`,
  417. `c90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  418. `c90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  419. FROM (((`c90`.`musicvideo` join `c90`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `c90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `c90`.`bookmark` on(((`c90`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`c90`.`bookmark`.`type` = 1))));
  420.  
  421. CREATE VIEW `c90`.`tvshowview`
  422. AS SELECT
  423. `tvshow`.`idShow` AS `idShow`,
  424. `tvshow`.`c00` AS `c00`,
  425. `tvshow`.`c01` AS `c01`,
  426. `tvshow`.`c02` AS `c02`,
  427. `tvshow`.`c03` AS `c03`,
  428. `tvshow`.`c04` AS `c04`,
  429. `tvshow`.`c05` AS `c05`,
  430. `tvshow`.`c06` AS `c06`,
  431. `tvshow`.`c07` AS `c07`,
  432. `tvshow`.`c08` AS `c08`,
  433. `tvshow`.`c09` AS `c09`,
  434. `tvshow`.`c10` AS `c10`,
  435. `tvshow`.`c11` AS `c11`,
  436. `tvshow`.`c12` AS `c12`,
  437. `tvshow`.`c13` AS `c13`,
  438. `tvshow`.`c14` AS `c14`,
  439. `tvshow`.`c15` AS `c15`,
  440. `tvshow`.`c16` AS `c16`,
  441. `tvshow`.`c17` AS `c17`,
  442. `tvshow`.`c18` AS `c18`,
  443. `tvshow`.`c19` AS `c19`,
  444. `tvshow`.`c20` AS `c20`,
  445. `tvshow`.`c21` AS `c21`,
  446. `tvshow`.`c22` AS `c22`,
  447. `tvshow`.`c23` AS `c23`,
  448. `path`.`strPath` AS `strPath`,
  449. `path`.`dateAdded` AS `dateAdded`,max(`files`.`lastPlayed`) AS `lastPlayed`,nullif(count(`episode`.`c12`),0) AS `totalCount`,count(`files`.`playCount`) AS `watchedcount`,nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`
  450. FROM ((((`c90`.`tvshow` left join `c90`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `c90`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `c90`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `c90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  451.  
  452. CREATE DATABASE d90;
  453.  
  454. CREATE VIEW `d90`.`actorlinkepisode` AS SELECT * FROM `a90`.`actorlinkepisode`;
  455. CREATE VIEW `d90`.`actorlinkmovie` AS SELECT * FROM `a90`.`actorlinkmovie`;
  456. CREATE VIEW `d90`.`actorlinktvshow` AS SELECT * FROM `a90`.`actorlinktvshow`;
  457. CREATE VIEW `d90`.`actors` AS SELECT * FROM `a90`.`actors`;
  458. CREATE VIEW `d90`.`art` AS SELECT * FROM `a90`.`art`;
  459. CREATE VIEW `d90`.`artistlinkmusicvideo` AS SELECT * FROM `a90`.`artistlinkmusicvideo`;
  460. CREATE VIEW `d90`.`country` AS SELECT * FROM `a90`.`country`;
  461. CREATE VIEW `d90`.`countrylinkmovie` AS SELECT * FROM `a90`.`countrylinkmovie`;
  462. CREATE VIEW `d90`.`directorlinkepisode` AS SELECT * FROM `a90`.`directorlinkepisode`;
  463. CREATE VIEW `d90`.`directorlinkmovie` AS SELECT * FROM `a90`.`directorlinkmovie`;
  464. CREATE VIEW `d90`.`directorlinkmusicvideo` AS SELECT * FROM `a90`.`directorlinkmusicvideo`;
  465. CREATE VIEW `d90`.`directorlinktvshow` AS SELECT * FROM `a90`.`directorlinktvshow`;
  466. CREATE VIEW `d90`.`episode` AS SELECT * FROM `a90`.`episode`;
  467. CREATE VIEW `d90`.`genre` AS SELECT * FROM `a90`.`genre`;
  468. CREATE VIEW `d90`.`genrelinkmovie` AS SELECT * FROM `a90`.`genrelinkmovie`;
  469. CREATE VIEW `d90`.`genrelinkmusicvideo` AS SELECT * FROM `a90`.`genrelinkmusicvideo`;
  470. CREATE VIEW `d90`.`genrelinktvshow` AS SELECT * FROM `a90`.`genrelinktvshow`;
  471. CREATE VIEW `d90`.`movie` AS SELECT * FROM `a90`.`movie`;
  472. CREATE VIEW `d90`.`movielinktvshow` AS SELECT * FROM `a90`.`movielinktvshow`;
  473. CREATE VIEW `d90`.`musicvideo` AS SELECT * FROM `a90`.`musicvideo`;
  474. CREATE VIEW `d90`.`path` AS SELECT * FROM `a90`.`path`;
  475. CREATE VIEW `d90`.`seasons` AS SELECT * FROM `a90`.`seasons`;
  476. CREATE VIEW `d90`.`sets` AS SELECT * FROM `a90`.`sets`;
  477. CREATE VIEW `d90`.`settings` AS SELECT * FROM `a90`.`settings`;
  478. CREATE VIEW `d90`.`stacktimes` AS SELECT * FROM `a90`.`stacktimes`;
  479. CREATE VIEW `d90`.`streamdetails` AS SELECT * FROM `a90`.`streamdetails`;
  480. CREATE VIEW `d90`.`studio` AS SELECT * FROM `a90`.`studio`;
  481. CREATE VIEW `d90`.`studiolinkmovie` AS SELECT * FROM `a90`.`studiolinkmovie`;
  482. CREATE VIEW `d90`.`studiolinkmusicvideo` AS SELECT * FROM `a90`.`studiolinkmusicvideo`;
  483. CREATE VIEW `d90`.`studiolinktvshow` AS SELECT * FROM `a90`.`studiolinktvshow`;
  484. CREATE VIEW `d90`.`tag` AS SELECT * FROM `a90`.`tag`;
  485. CREATE VIEW `d90`.`taglinks` AS SELECT * FROM `a90`.`taglinks`;
  486. CREATE VIEW `d90`.`tvshow` AS SELECT * FROM `a90`.`tvshow`;
  487. CREATE VIEW `d90`.`tvshowlinkpath` AS SELECT * FROM `a90`.`tvshowlinkpath`;
  488. CREATE VIEW `d90`.`version` AS SELECT * FROM `a90`.`version`;
  489. CREATE VIEW `d90`.`writerlinkepisode` AS SELECT * FROM `a90`.`writerlinkepisode`;
  490. CREATE VIEW `d90`.`writerlinkmovie` AS SELECT * FROM `a90`.`writerlinkmovie`;
  491.  
  492. CREATE VIEW `d90`.`files`
  493. AS SELECT
  494. `a90`.`globalfiles`.`idFile` AS `idFile`,
  495. `a90`.`globalfiles`.`idPath` AS `idPath`,
  496. `a90`.`globalfiles`.`strFilename` AS `strFilename`,
  497. `a90`.`globalfiles`.`playCount4` AS `playCount`,
  498. `a90`.`globalfiles`.`lastPlayed4` AS `lastPlayed`,
  499. `a90`.`globalfiles`.`dateAdded` AS `dateAdded`
  500. FROM `a90`.`globalfiles`;
  501.  
  502. CREATE TABLE `d90`.`bookmark` (
  503. `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
  504. `idFile` int(11) DEFAULT NULL,
  505. `timeInSeconds` double DEFAULT NULL,
  506. `totalTimeInSeconds` double DEFAULT NULL,
  507. `thumbNailImage` text,
  508. `player` text,
  509. `playerState` text,
  510. `type` int(11) DEFAULT NULL,
  511. PRIMARY KEY (`idBookmark`),
  512. KEY `ix_bookmark` (`idFile`,`type`)
  513. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  514.  
  515. CREATE VIEW `d90`.`episodeview`
  516. AS SELECT
  517. `episode`.`idEpisode` AS `idEpisode`,
  518. `episode`.`idFile` AS `idFile`,
  519. `episode`.`c00` AS `c00`,
  520. `episode`.`c01` AS `c01`,
  521. `episode`.`c02` AS `c02`,
  522. `episode`.`c03` AS `c03`,
  523. `episode`.`c04` AS `c04`,
  524. `episode`.`c05` AS `c05`,
  525. `episode`.`c06` AS `c06`,
  526. `episode`.`c07` AS `c07`,
  527. `episode`.`c08` AS `c08`,
  528. `episode`.`c09` AS `c09`,
  529. `episode`.`c10` AS `c10`,
  530. `episode`.`c11` AS `c11`,
  531. `episode`.`c12` AS `c12`,
  532. `episode`.`c13` AS `c13`,
  533. `episode`.`c14` AS `c14`,
  534. `episode`.`c15` AS `c15`,
  535. `episode`.`c16` AS `c16`,
  536. `episode`.`c17` AS `c17`,
  537. `episode`.`c18` AS `c18`,
  538. `episode`.`c19` AS `c19`,
  539. `episode`.`c20` AS `c20`,
  540. `episode`.`c21` AS `c21`,
  541. `episode`.`c22` AS `c22`,
  542. `episode`.`c23` AS `c23`,
  543. `episode`.`idShow` AS `idShow`,
  544. `files`.`strFilename` AS `strFileName`,
  545. `path`.`strPath` AS `strPath`,
  546. `files`.`playCount` AS `playCount`,
  547. `files`.`lastPlayed` AS `lastPlayed`,
  548. `files`.`dateAdded` AS `dateAdded`,
  549. `tvshow`.`c00` AS `strTitle`,
  550. `tvshow`.`c14` AS `strStudio`,
  551. `tvshow`.`c05` AS `premiered`,
  552. `tvshow`.`c13` AS `mpaa`,
  553. `tvshow`.`c16` AS `strShowPath`,
  554. `d90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  555. `d90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  556. `seasons`.`idSeason` AS `idSeason`
  557. FROM (((((`d90`.`episode` join `d90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `d90`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `d90`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `d90`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `d90`.`bookmark` on(((`d90`.`bookmark`.`idFile` = `episode`.`idFile`) and (`d90`.`bookmark`.`type` = 1))));
  558.  
  559. CREATE VIEW `d90`.`movieview`
  560. AS SELECT
  561. `movie`.`idMovie` AS `idMovie`,
  562. `movie`.`idFile` AS `idFile`,
  563. `movie`.`c00` AS `c00`,
  564. `movie`.`c01` AS `c01`,
  565. `movie`.`c02` AS `c02`,
  566. `movie`.`c03` AS `c03`,
  567. `movie`.`c04` AS `c04`,
  568. `movie`.`c05` AS `c05`,
  569. `movie`.`c06` AS `c06`,
  570. `movie`.`c07` AS `c07`,
  571. `movie`.`c08` AS `c08`,
  572. `movie`.`c09` AS `c09`,
  573. `movie`.`c10` AS `c10`,
  574. `movie`.`c11` AS `c11`,
  575. `movie`.`c12` AS `c12`,
  576. `movie`.`c13` AS `c13`,
  577. `movie`.`c14` AS `c14`,
  578. `movie`.`c15` AS `c15`,
  579. `movie`.`c16` AS `c16`,
  580. `movie`.`c17` AS `c17`,
  581. `movie`.`c18` AS `c18`,
  582. `movie`.`c19` AS `c19`,
  583. `movie`.`c20` AS `c20`,
  584. `movie`.`c21` AS `c21`,
  585. `movie`.`c22` AS `c22`,
  586. `movie`.`c23` AS `c23`,
  587. `movie`.`idSet` AS `idSet`,
  588. `sets`.`strSet` AS `strSet`,
  589. `files`.`strFilename` AS `strFileName`,
  590. `path`.`strPath` AS `strPath`,
  591. `files`.`playCount` AS `playCount`,
  592. `files`.`lastPlayed` AS `lastPlayed`,
  593. `files`.`dateAdded` AS `dateAdded`,
  594. `d90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  595. `d90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  596. FROM ((((`d90`.`movie` left join `d90`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `d90`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `d90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `d90`.`bookmark` on(((`d90`.`bookmark`.`idFile` = `movie`.`idFile`) and (`d90`.`bookmark`.`type` = 1))));
  597.  
  598. CREATE VIEW `d90`.`musicvideoview`
  599. AS SELECT
  600. `musicvideo`.`idMVideo` AS `idMVideo`,
  601. `musicvideo`.`idFile` AS `idFile`,
  602. `musicvideo`.`c00` AS `c00`,
  603. `musicvideo`.`c01` AS `c01`,
  604. `musicvideo`.`c02` AS `c02`,
  605. `musicvideo`.`c03` AS `c03`,
  606. `musicvideo`.`c04` AS `c04`,
  607. `musicvideo`.`c05` AS `c05`,
  608. `musicvideo`.`c06` AS `c06`,
  609. `musicvideo`.`c07` AS `c07`,
  610. `musicvideo`.`c08` AS `c08`,
  611. `musicvideo`.`c09` AS `c09`,
  612. `musicvideo`.`c10` AS `c10`,
  613. `musicvideo`.`c11` AS `c11`,
  614. `musicvideo`.`c12` AS `c12`,
  615. `musicvideo`.`c13` AS `c13`,
  616. `musicvideo`.`c14` AS `c14`,
  617. `musicvideo`.`c15` AS `c15`,
  618. `musicvideo`.`c16` AS `c16`,
  619. `musicvideo`.`c17` AS `c17`,
  620. `musicvideo`.`c18` AS `c18`,
  621. `musicvideo`.`c19` AS `c19`,
  622. `musicvideo`.`c20` AS `c20`,
  623. `musicvideo`.`c21` AS `c21`,
  624. `musicvideo`.`c22` AS `c22`,
  625. `musicvideo`.`c23` AS `c23`,
  626. `files`.`strFilename` AS `strFileName`,
  627. `path`.`strPath` AS `strPath`,
  628. `files`.`playCount` AS `playCount`,
  629. `files`.`lastPlayed` AS `lastPlayed`,
  630. `files`.`dateAdded` AS `dateAdded`,
  631. `d90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  632. `d90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  633. FROM (((`d90`.`musicvideo` join `d90`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `d90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `d90`.`bookmark` on(((`d90`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`d90`.`bookmark`.`type` = 1))));
  634.  
  635. CREATE VIEW `d90`.`tvshowview`
  636. AS SELECT
  637. `tvshow`.`idShow` AS `idShow`,
  638. `tvshow`.`c00` AS `c00`,
  639. `tvshow`.`c01` AS `c01`,
  640. `tvshow`.`c02` AS `c02`,
  641. `tvshow`.`c03` AS `c03`,
  642. `tvshow`.`c04` AS `c04`,
  643. `tvshow`.`c05` AS `c05`,
  644. `tvshow`.`c06` AS `c06`,
  645. `tvshow`.`c07` AS `c07`,
  646. `tvshow`.`c08` AS `c08`,
  647. `tvshow`.`c09` AS `c09`,
  648. `tvshow`.`c10` AS `c10`,
  649. `tvshow`.`c11` AS `c11`,
  650. `tvshow`.`c12` AS `c12`,
  651. `tvshow`.`c13` AS `c13`,
  652. `tvshow`.`c14` AS `c14`,
  653. `tvshow`.`c15` AS `c15`,
  654. `tvshow`.`c16` AS `c16`,
  655. `tvshow`.`c17` AS `c17`,
  656. `tvshow`.`c18` AS `c18`,
  657. `tvshow`.`c19` AS `c19`,
  658. `tvshow`.`c20` AS `c20`,
  659. `tvshow`.`c21` AS `c21`,
  660. `tvshow`.`c22` AS `c22`,
  661. `tvshow`.`c23` AS `c23`,
  662. `path`.`strPath` AS `strPath`,
  663. `path`.`dateAdded` AS `dateAdded`,max(`files`.`lastPlayed`) AS `lastPlayed`,nullif(count(`episode`.`c12`),0) AS `totalCount`,count(`files`.`playCount`) AS `watchedcount`,nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`
  664. FROM ((((`d90`.`tvshow` left join `d90`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `d90`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `d90`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `d90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  665.  
  666. CREATE DATABASE e90;
  667.  
  668. CREATE VIEW `e90`.`actorlinkepisode` AS SELECT * FROM `a90`.`actorlinkepisode`;
  669. CREATE VIEW `e90`.`actorlinkmovie` AS SELECT * FROM `a90`.`actorlinkmovie`;
  670. CREATE VIEW `e90`.`actorlinktvshow` AS SELECT * FROM `a90`.`actorlinktvshow`;
  671. CREATE VIEW `e90`.`actors` AS SELECT * FROM `a90`.`actors`;
  672. CREATE VIEW `e90`.`art` AS SELECT * FROM `a90`.`art`;
  673. CREATE VIEW `e90`.`artistlinkmusicvideo` AS SELECT * FROM `a90`.`artistlinkmusicvideo`;
  674. CREATE VIEW `e90`.`country` AS SELECT * FROM `a90`.`country`;
  675. CREATE VIEW `e90`.`countrylinkmovie` AS SELECT * FROM `a90`.`countrylinkmovie`;
  676. CREATE VIEW `e90`.`directorlinkepisode` AS SELECT * FROM `a90`.`directorlinkepisode`;
  677. CREATE VIEW `e90`.`directorlinkmovie` AS SELECT * FROM `a90`.`directorlinkmovie`;
  678. CREATE VIEW `e90`.`directorlinkmusicvideo` AS SELECT * FROM `a90`.`directorlinkmusicvideo`;
  679. CREATE VIEW `e90`.`directorlinktvshow` AS SELECT * FROM `a90`.`directorlinktvshow`;
  680. CREATE VIEW `e90`.`episode` AS SELECT * FROM `a90`.`episode`;
  681. CREATE VIEW `e90`.`genre` AS SELECT * FROM `a90`.`genre`;
  682. CREATE VIEW `e90`.`genrelinkmovie` AS SELECT * FROM `a90`.`genrelinkmovie`;
  683. CREATE VIEW `e90`.`genrelinkmusicvideo` AS SELECT * FROM `a90`.`genrelinkmusicvideo`;
  684. CREATE VIEW `e90`.`genrelinktvshow` AS SELECT * FROM `a90`.`genrelinktvshow`;
  685. CREATE VIEW `e90`.`movie` AS SELECT * FROM `a90`.`movie`;
  686. CREATE VIEW `e90`.`movielinktvshow` AS SELECT * FROM `a90`.`movielinktvshow`;
  687. CREATE VIEW `e90`.`musicvideo` AS SELECT * FROM `a90`.`musicvideo`;
  688. CREATE VIEW `e90`.`path` AS SELECT * FROM `a90`.`path`;
  689. CREATE VIEW `e90`.`seasons` AS SELECT * FROM `a90`.`seasons`;
  690. CREATE VIEW `e90`.`sets` AS SELECT * FROM `a90`.`sets`;
  691. CREATE VIEW `e90`.`settings` AS SELECT * FROM `a90`.`settings`;
  692. CREATE VIEW `e90`.`stacktimes` AS SELECT * FROM `a90`.`stacktimes`;
  693. CREATE VIEW `e90`.`streamdetails` AS SELECT * FROM `a90`.`streamdetails`;
  694. CREATE VIEW `e90`.`studio` AS SELECT * FROM `a90`.`studio`;
  695. CREATE VIEW `e90`.`studiolinkmovie` AS SELECT * FROM `a90`.`studiolinkmovie`;
  696. CREATE VIEW `e90`.`studiolinkmusicvideo` AS SELECT * FROM `a90`.`studiolinkmusicvideo`;
  697. CREATE VIEW `e90`.`studiolinktvshow` AS SELECT * FROM `a90`.`studiolinktvshow`;
  698. CREATE VIEW `e90`.`tag` AS SELECT * FROM `a90`.`tag`;
  699. CREATE VIEW `e90`.`taglinks` AS SELECT * FROM `a90`.`taglinks`;
  700. CREATE VIEW `e90`.`tvshow` AS SELECT * FROM `a90`.`tvshow`;
  701. CREATE VIEW `e90`.`tvshowlinkpath` AS SELECT * FROM `a90`.`tvshowlinkpath`;
  702. CREATE VIEW `e90`.`version` AS SELECT * FROM `a90`.`version`;
  703. CREATE VIEW `e90`.`writerlinkepisode` AS SELECT * FROM `a90`.`writerlinkepisode`;
  704. CREATE VIEW `e90`.`writerlinkmovie` AS SELECT * FROM `a90`.`writerlinkmovie`;
  705.  
  706. CREATE VIEW `e90`.`files`
  707. AS SELECT
  708. `a90`.`globalfiles`.`idFile` AS `idFile`,
  709. `a90`.`globalfiles`.`idPath` AS `idPath`,
  710. `a90`.`globalfiles`.`strFilename` AS `strFilename`,
  711. `a90`.`globalfiles`.`playCount5` AS `playCount`,
  712. `a90`.`globalfiles`.`lastPlayed5` AS `lastPlayed`,
  713. `a90`.`globalfiles`.`dateAdded` AS `dateAdded`
  714. FROM `a90`.`globalfiles`;
  715.  
  716. CREATE TABLE `e90`.`bookmark` (
  717. `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
  718. `idFile` int(11) DEFAULT NULL,
  719. `timeInSeconds` double DEFAULT NULL,
  720. `totalTimeInSeconds` double DEFAULT NULL,
  721. `thumbNailImage` text,
  722. `player` text,
  723. `playerState` text,
  724. `type` int(11) DEFAULT NULL,
  725. PRIMARY KEY (`idBookmark`),
  726. KEY `ix_bookmark` (`idFile`,`type`)
  727. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  728.  
  729. CREATE VIEW `e90`.`episodeview`
  730. AS SELECT
  731. `episode`.`idEpisode` AS `idEpisode`,
  732. `episode`.`idFile` AS `idFile`,
  733. `episode`.`c00` AS `c00`,
  734. `episode`.`c01` AS `c01`,
  735. `episode`.`c02` AS `c02`,
  736. `episode`.`c03` AS `c03`,
  737. `episode`.`c04` AS `c04`,
  738. `episode`.`c05` AS `c05`,
  739. `episode`.`c06` AS `c06`,
  740. `episode`.`c07` AS `c07`,
  741. `episode`.`c08` AS `c08`,
  742. `episode`.`c09` AS `c09`,
  743. `episode`.`c10` AS `c10`,
  744. `episode`.`c11` AS `c11`,
  745. `episode`.`c12` AS `c12`,
  746. `episode`.`c13` AS `c13`,
  747. `episode`.`c14` AS `c14`,
  748. `episode`.`c15` AS `c15`,
  749. `episode`.`c16` AS `c16`,
  750. `episode`.`c17` AS `c17`,
  751. `episode`.`c18` AS `c18`,
  752. `episode`.`c19` AS `c19`,
  753. `episode`.`c20` AS `c20`,
  754. `episode`.`c21` AS `c21`,
  755. `episode`.`c22` AS `c22`,
  756. `episode`.`c23` AS `c23`,
  757. `episode`.`idShow` AS `idShow`,
  758. `files`.`strFilename` AS `strFileName`,
  759. `path`.`strPath` AS `strPath`,
  760. `files`.`playCount` AS `playCount`,
  761. `files`.`lastPlayed` AS `lastPlayed`,
  762. `files`.`dateAdded` AS `dateAdded`,
  763. `tvshow`.`c00` AS `strTitle`,
  764. `tvshow`.`c14` AS `strStudio`,
  765. `tvshow`.`c05` AS `premiered`,
  766. `tvshow`.`c13` AS `mpaa`,
  767. `tvshow`.`c16` AS `strShowPath`,
  768. `e90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  769. `e90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  770. `seasons`.`idSeason` AS `idSeason`
  771. FROM (((((`e90`.`episode` join `e90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `e90`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `e90`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `e90`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `e90`.`bookmark` on(((`e90`.`bookmark`.`idFile` = `episode`.`idFile`) and (`e90`.`bookmark`.`type` = 1))));
  772.  
  773. CREATE VIEW `e90`.`movieview`
  774. AS SELECT
  775. `movie`.`idMovie` AS `idMovie`,
  776. `movie`.`idFile` AS `idFile`,
  777. `movie`.`c00` AS `c00`,
  778. `movie`.`c01` AS `c01`,
  779. `movie`.`c02` AS `c02`,
  780. `movie`.`c03` AS `c03`,
  781. `movie`.`c04` AS `c04`,
  782. `movie`.`c05` AS `c05`,
  783. `movie`.`c06` AS `c06`,
  784. `movie`.`c07` AS `c07`,
  785. `movie`.`c08` AS `c08`,
  786. `movie`.`c09` AS `c09`,
  787. `movie`.`c10` AS `c10`,
  788. `movie`.`c11` AS `c11`,
  789. `movie`.`c12` AS `c12`,
  790. `movie`.`c13` AS `c13`,
  791. `movie`.`c14` AS `c14`,
  792. `movie`.`c15` AS `c15`,
  793. `movie`.`c16` AS `c16`,
  794. `movie`.`c17` AS `c17`,
  795. `movie`.`c18` AS `c18`,
  796. `movie`.`c19` AS `c19`,
  797. `movie`.`c20` AS `c20`,
  798. `movie`.`c21` AS `c21`,
  799. `movie`.`c22` AS `c22`,
  800. `movie`.`c23` AS `c23`,
  801. `movie`.`idSet` AS `idSet`,
  802. `sets`.`strSet` AS `strSet`,
  803. `files`.`strFilename` AS `strFileName`,
  804. `path`.`strPath` AS `strPath`,
  805. `files`.`playCount` AS `playCount`,
  806. `files`.`lastPlayed` AS `lastPlayed`,
  807. `files`.`dateAdded` AS `dateAdded`,
  808. `e90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  809. `e90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  810. FROM ((((`e90`.`movie` left join `e90`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `e90`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `e90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `e90`.`bookmark` on(((`e90`.`bookmark`.`idFile` = `movie`.`idFile`) and (`e90`.`bookmark`.`type` = 1))));
  811.  
  812. CREATE VIEW `e90`.`musicvideoview`
  813. AS SELECT
  814. `musicvideo`.`idMVideo` AS `idMVideo`,
  815. `musicvideo`.`idFile` AS `idFile`,
  816. `musicvideo`.`c00` AS `c00`,
  817. `musicvideo`.`c01` AS `c01`,
  818. `musicvideo`.`c02` AS `c02`,
  819. `musicvideo`.`c03` AS `c03`,
  820. `musicvideo`.`c04` AS `c04`,
  821. `musicvideo`.`c05` AS `c05`,
  822. `musicvideo`.`c06` AS `c06`,
  823. `musicvideo`.`c07` AS `c07`,
  824. `musicvideo`.`c08` AS `c08`,
  825. `musicvideo`.`c09` AS `c09`,
  826. `musicvideo`.`c10` AS `c10`,
  827. `musicvideo`.`c11` AS `c11`,
  828. `musicvideo`.`c12` AS `c12`,
  829. `musicvideo`.`c13` AS `c13`,
  830. `musicvideo`.`c14` AS `c14`,
  831. `musicvideo`.`c15` AS `c15`,
  832. `musicvideo`.`c16` AS `c16`,
  833. `musicvideo`.`c17` AS `c17`,
  834. `musicvideo`.`c18` AS `c18`,
  835. `musicvideo`.`c19` AS `c19`,
  836. `musicvideo`.`c20` AS `c20`,
  837. `musicvideo`.`c21` AS `c21`,
  838. `musicvideo`.`c22` AS `c22`,
  839. `musicvideo`.`c23` AS `c23`,
  840. `files`.`strFilename` AS `strFileName`,
  841. `path`.`strPath` AS `strPath`,
  842. `files`.`playCount` AS `playCount`,
  843. `files`.`lastPlayed` AS `lastPlayed`,
  844. `files`.`dateAdded` AS `dateAdded`,
  845. `e90`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  846. `e90`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  847. FROM (((`e90`.`musicvideo` join `e90`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `e90`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `e90`.`bookmark` on(((`e90`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`e90`.`bookmark`.`type` = 1))));
  848.  
  849. CREATE VIEW `e90`.`tvshowview`
  850. AS SELECT
  851. `tvshow`.`idShow` AS `idShow`,
  852. `tvshow`.`c00` AS `c00`,
  853. `tvshow`.`c01` AS `c01`,
  854. `tvshow`.`c02` AS `c02`,
  855. `tvshow`.`c03` AS `c03`,
  856. `tvshow`.`c04` AS `c04`,
  857. `tvshow`.`c05` AS `c05`,
  858. `tvshow`.`c06` AS `c06`,
  859. `tvshow`.`c07` AS `c07`,
  860. `tvshow`.`c08` AS `c08`,
  861. `tvshow`.`c09` AS `c09`,
  862. `tvshow`.`c10` AS `c10`,
  863. `tvshow`.`c11` AS `c11`,
  864. `tvshow`.`c12` AS `c12`,
  865. `tvshow`.`c13` AS `c13`,
  866. `tvshow`.`c14` AS `c14`,
  867. `tvshow`.`c15` AS `c15`,
  868. `tvshow`.`c16` AS `c16`,
  869. `tvshow`.`c17` AS `c17`,
  870. `tvshow`.`c18` AS `c18`,
  871. `tvshow`.`c19` AS `c19`,
  872. `tvshow`.`c20` AS `c20`,
  873. `tvshow`.`c21` AS `c21`,
  874. `tvshow`.`c22` AS `c22`,
  875. `tvshow`.`c23` AS `c23`,
  876. `path`.`strPath` AS `strPath`,
  877. `path`.`dateAdded` AS `dateAdded`,max(`files`.`lastPlayed`) AS `lastPlayed`,nullif(count(`episode`.`c12`),0) AS `totalCount`,count(`files`.`playCount`) AS `watchedcount`,nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`
  878. FROM ((((`e90`.`tvshow` left join `e90`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `e90`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `e90`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `e90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  879.  
  880.  
  881.  
  882.  
  883.  
  884. RENAME TABLE `a48`.`song` to `a48`.`globalsong`;
  885.  
  886. ALTER TABLE `a48`.`globalsong` CHANGE iTimesPlayed iTimesPlayed1 INT;
  887. ALTER TABLE `a48`.`globalsong` ADD iTimesPlayed2 INT(11) AFTER iTimesPlayed1;
  888. ALTER TABLE `a48`.`globalsong` ADD iTimesPlayed3 INT(11) AFTER iTimesPlayed2;
  889. ALTER TABLE `a48`.`globalsong` ADD iTimesPlayed4 INT(11) AFTER iTimesPlayed3;
  890. ALTER TABLE `a48`.`globalsong` ADD iTimesPlayed5 INT(11) AFTER iTimesPlayed4;
  891. ALTER TABLE `a48`.`globalsong` CHANGE lastPlayed lastPlayed1 VARCHAR(20);
  892. ALTER TABLE `a48`.`globalsong` ADD lastPlayed2 VARCHAR(20) AFTER lastPlayed1;
  893. ALTER TABLE `a48`.`globalsong` ADD lastPlayed3 VARCHAR(20) AFTER lastPlayed2;
  894. ALTER TABLE `a48`.`globalsong` ADD lastPlayed4 VARCHAR(20) AFTER lastPlayed3;
  895. ALTER TABLE `a48`.`globalsong` ADD lastPlayed5 VARCHAR(20) AFTER lastPlayed4;
  896.  
  897. CREATE VIEW `a48`.`song`
  898. AS SELECT
  899. `a48`.`globalsong`.`idSong` AS `idSong`,
  900. `a48`.`globalsong`.`idAlbum` AS `idAlbum`,
  901. `a48`.`globalsong`.`idPath` AS `idPath`,
  902. `a48`.`globalsong`.`strArtists` AS `strArtists`,
  903. `a48`.`globalsong`.`strGenres` AS `strGenres`,
  904. `a48`.`globalsong`.`strTitle` AS `strTitle`,
  905. `a48`.`globalsong`.`iTrack` AS `iTrack`,
  906. `a48`.`globalsong`.`iDuration` AS `iDuration`,
  907. `a48`.`globalsong`.`iYear` AS `iYear`,
  908. `a48`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  909. `a48`.`globalsong`.`strFileName` AS `strFileName`,
  910. `a48`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  911. `a48`.`globalsong`.`iTimesPlayed1` AS `iTimesPlayed`,
  912. `a48`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  913. `a48`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  914. `a48`.`globalsong`.`idThumb` AS `idThumb`,
  915. `a48`.`globalsong`.`lastplayed1` AS `lastplayed`,
  916. `a48`.`globalsong`.`comment` AS `comment`,
  917. `a48`.`globalsong`.`rating` AS `rating`
  918. FROM `a48`.`globalsong`;
  919.  
  920. CREATE DATABASE b48;
  921. CREATE VIEW `b48`.`album` AS SELECT * FROM `a48`.`album`;
  922. CREATE VIEW `b48`.`album_artist` AS SELECT * FROM `a48`.`album_artist`;
  923. CREATE VIEW `b48`.`album_genre` AS SELECT * FROM `a48`.`album_genre`;
  924. CREATE VIEW `b48`.`albuminfosong` AS SELECT * FROM `a48`.`albuminfosong`;
  925. CREATE VIEW `b48`.`art` AS SELECT * FROM `a48`.`art`;
  926. CREATE VIEW `b48`.`artist` AS SELECT * FROM `a48`.`artist`;
  927. CREATE VIEW `b48`.`content` AS SELECT * FROM `a48`.`content`;
  928. CREATE VIEW `b48`.`discography` AS SELECT * FROM `a48`.`discography`;
  929. CREATE VIEW `b48`.`genre` AS SELECT * FROM `a48`.`genre`;
  930. CREATE VIEW `b48`.`karaokedata` AS SELECT * FROM `a48`.`karaokedata`;
  931. CREATE VIEW `b48`.`path` AS SELECT * FROM `a48`.`path`;
  932. CREATE VIEW `b48`.`song_artist` AS SELECT * FROM `a48`.`song_artist`;
  933. CREATE VIEW `b48`.`song_genre` AS SELECT * FROM `a48`.`song_genre`;
  934. CREATE VIEW `b48`.`version` AS SELECT * FROM `a48`.`version`;
  935.  
  936. CREATE VIEW `b48`.`song`
  937. AS SELECT
  938. `a48`.`globalsong`.`idSong` AS `idSong`,
  939. `a48`.`globalsong`.`idAlbum` AS `idAlbum`,
  940. `a48`.`globalsong`.`idPath` AS `idPath`,
  941. `a48`.`globalsong`.`strArtists` AS `strArtists`,
  942. `a48`.`globalsong`.`strGenres` AS `strGenres`,
  943. `a48`.`globalsong`.`strTitle` AS `strTitle`,
  944. `a48`.`globalsong`.`iTrack` AS `iTrack`,
  945. `a48`.`globalsong`.`iDuration` AS `iDuration`,
  946. `a48`.`globalsong`.`iYear` AS `iYear`,
  947. `a48`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  948. `a48`.`globalsong`.`strFileName` AS `strFileName`,
  949. `a48`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  950. `a48`.`globalsong`.`iTimesPlayed2` AS `iTimesPlayed`,
  951. `a48`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  952. `a48`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  953. `a48`.`globalsong`.`idThumb` AS `idThumb`,
  954. `a48`.`globalsong`.`lastplayed2` AS `lastplayed`,
  955. `a48`.`globalsong`.`comment` AS `comment`,
  956. `a48`.`globalsong`.`rating` AS `rating`
  957. FROM `a48`.`globalsong`;
  958.  
  959. CREATE VIEW `b48`.`albumartistview`
  960. AS SELECT
  961. `album_artist`.`idAlbum` AS `idAlbum`,
  962. `album_artist`.`idArtist` AS `idArtist`,
  963. `artist`.`strArtist` AS `strArtist`,
  964. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  965. `album_artist`.`boolFeatured` AS `boolFeatured`,
  966. `album_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  967. `album_artist`.`iOrder` AS `iOrder`
  968. FROM (`b48`.`album_artist` join `b48`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  969.  
  970. CREATE VIEW `b48`.`albumview`
  971. AS SELECT
  972. `album`.`idAlbum` AS `idAlbum`,
  973. `album`.`strAlbum` AS `strAlbum`,
  974. `album`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,
  975. `album`.`strArtists` AS `strArtists`,
  976. `album`.`strGenres` AS `strGenres`,
  977. `album`.`iYear` AS `iYear`,
  978. `album`.`strMoods` AS `strMoods`,
  979. `album`.`strStyles` AS `strStyles`,
  980. `album`.`strThemes` AS `strThemes`,
  981. `album`.`strReview` AS `strReview`,
  982. `album`.`strLabel` AS `strLabel`,
  983. `album`.`strType` AS `strType`,
  984. `album`.`strImage` AS `strImage`,
  985. `album`.`iRating` AS `iRating`,
  986. `album`.`bCompilation` AS `bCompilation`,min(`song`.`iTimesPlayed`) AS `iTimesPlayed`
  987. FROM (`b48`.`album` left join `b48`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  988.  
  989. CREATE VIEW `b48`.`artistview`
  990. AS SELECT
  991. `artist`.`idArtist` AS `idArtist`,
  992. `artist`.`strArtist` AS `strArtist`,
  993. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  994. `artist`.`strBorn` AS `strBorn`,
  995. `artist`.`strFormed` AS `strFormed`,
  996. `artist`.`strGenres` AS `strGenres`,
  997. `artist`.`strMoods` AS `strMoods`,
  998. `artist`.`strStyles` AS `strStyles`,
  999. `artist`.`strInstruments` AS `strInstruments`,
  1000. `artist`.`strBiography` AS `strBiography`,
  1001. `artist`.`strDied` AS `strDied`,
  1002. `artist`.`strDisbanded` AS `strDisbanded`,
  1003. `artist`.`strYearsActive` AS `strYearsActive`,
  1004. `artist`.`strImage` AS `strImage`,
  1005. `artist`.`strFanart` AS `strFanart`
  1006. FROM `b48`.`artist`;
  1007.  
  1008. CREATE VIEW `b48`.`songartistview`
  1009. AS SELECT
  1010. `song_artist`.`idSong` AS `idSong`,
  1011. `song_artist`.`idArtist` AS `idArtist`,
  1012. `artist`.`strArtist` AS `strArtist`,
  1013. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1014. `song_artist`.`boolFeatured` AS `boolFeatured`,
  1015. `song_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1016. `song_artist`.`iOrder` AS `iOrder`
  1017. FROM (`b48`.`song_artist` join `b48`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1018.  
  1019. CREATE VIEW `b48`.`songview`
  1020. AS SELECT
  1021. `song`.`idSong` AS `idSong`,
  1022. `song`.`strArtists` AS `strArtists`,
  1023. `song`.`strGenres` AS `strGenres`,
  1024. `song`.`strTitle` AS `strTitle`,
  1025. `song`.`iTrack` AS `iTrack`,
  1026. `song`.`iDuration` AS `iDuration`,
  1027. `song`.`iYear` AS `iYear`,
  1028. `song`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1029. `song`.`strFileName` AS `strFileName`,
  1030. `song`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1031. `song`.`iTimesPlayed` AS `iTimesPlayed`,
  1032. `song`.`iStartOffset` AS `iStartOffset`,
  1033. `song`.`iEndOffset` AS `iEndOffset`,
  1034. `song`.`lastplayed` AS `lastplayed`,
  1035. `song`.`rating` AS `rating`,
  1036. `song`.`comment` AS `comment`,
  1037. `song`.`idAlbum` AS `idAlbum`,
  1038. `album`.`strAlbum` AS `strAlbum`,
  1039. `path`.`strPath` AS `strPath`,
  1040. `karaokedata`.`iKaraNumber` AS `iKaraNumber`,
  1041. `karaokedata`.`iKaraDelay` AS `iKaraDelay`,
  1042. `karaokedata`.`strKaraEncoding` AS `strKaraEncoding`,
  1043. `album`.`bCompilation` AS `bCompilation`,
  1044. `album`.`strArtists` AS `strAlbumArtists`
  1045. FROM (((`b48`.`song` join `b48`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `b48`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `b48`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1046.  
  1047. CREATE DATABASE c48;
  1048. CREATE VIEW `c48`.`album` AS SELECT * FROM `a48`.`album`;
  1049. CREATE VIEW `c48`.`album_artist` AS SELECT * FROM `a48`.`album_artist`;
  1050. CREATE VIEW `c48`.`album_genre` AS SELECT * FROM `a48`.`album_genre`;
  1051. CREATE VIEW `c48`.`albuminfosong` AS SELECT * FROM `a48`.`albuminfosong`;
  1052. CREATE VIEW `c48`.`art` AS SELECT * FROM `a48`.`art`;
  1053. CREATE VIEW `c48`.`artist` AS SELECT * FROM `a48`.`artist`;
  1054. CREATE VIEW `c48`.`content` AS SELECT * FROM `a48`.`content`;
  1055. CREATE VIEW `c48`.`discography` AS SELECT * FROM `a48`.`discography`;
  1056. CREATE VIEW `c48`.`genre` AS SELECT * FROM `a48`.`genre`;
  1057. CREATE VIEW `c48`.`karaokedata` AS SELECT * FROM `a48`.`karaokedata`;
  1058. CREATE VIEW `c48`.`path` AS SELECT * FROM `a48`.`path`;
  1059. CREATE VIEW `c48`.`song_artist` AS SELECT * FROM `a48`.`song_artist`;
  1060. CREATE VIEW `c48`.`song_genre` AS SELECT * FROM `a48`.`song_genre`;
  1061. CREATE VIEW `c48`.`version` AS SELECT * FROM `a48`.`version`;
  1062.  
  1063. CREATE VIEW `c48`.`song`
  1064. AS SELECT
  1065. `a48`.`globalsong`.`idSong` AS `idSong`,
  1066. `a48`.`globalsong`.`idAlbum` AS `idAlbum`,
  1067. `a48`.`globalsong`.`idPath` AS `idPath`,
  1068. `a48`.`globalsong`.`strArtists` AS `strArtists`,
  1069. `a48`.`globalsong`.`strGenres` AS `strGenres`,
  1070. `a48`.`globalsong`.`strTitle` AS `strTitle`,
  1071. `a48`.`globalsong`.`iTrack` AS `iTrack`,
  1072. `a48`.`globalsong`.`iDuration` AS `iDuration`,
  1073. `a48`.`globalsong`.`iYear` AS `iYear`,
  1074. `a48`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1075. `a48`.`globalsong`.`strFileName` AS `strFileName`,
  1076. `a48`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1077. `a48`.`globalsong`.`iTimesPlayed3` AS `iTimesPlayed`,
  1078. `a48`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1079. `a48`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1080. `a48`.`globalsong`.`idThumb` AS `idThumb`,
  1081. `a48`.`globalsong`.`lastplayed3` AS `lastplayed`,
  1082. `a48`.`globalsong`.`comment` AS `comment`,
  1083. `a48`.`globalsong`.`rating` AS `rating`
  1084. FROM `a48`.`globalsong`;
  1085.  
  1086. CREATE VIEW `c48`.`albumartistview`
  1087. AS SELECT
  1088. `album_artist`.`idAlbum` AS `idAlbum`,
  1089. `album_artist`.`idArtist` AS `idArtist`,
  1090. `artist`.`strArtist` AS `strArtist`,
  1091. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1092. `album_artist`.`boolFeatured` AS `boolFeatured`,
  1093. `album_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1094. `album_artist`.`iOrder` AS `iOrder`
  1095. FROM (`c48`.`album_artist` join `c48`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1096.  
  1097. CREATE VIEW `c48`.`albumview`
  1098. AS SELECT
  1099. `album`.`idAlbum` AS `idAlbum`,
  1100. `album`.`strAlbum` AS `strAlbum`,
  1101. `album`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,
  1102. `album`.`strArtists` AS `strArtists`,
  1103. `album`.`strGenres` AS `strGenres`,
  1104. `album`.`iYear` AS `iYear`,
  1105. `album`.`strMoods` AS `strMoods`,
  1106. `album`.`strStyles` AS `strStyles`,
  1107. `album`.`strThemes` AS `strThemes`,
  1108. `album`.`strReview` AS `strReview`,
  1109. `album`.`strLabel` AS `strLabel`,
  1110. `album`.`strType` AS `strType`,
  1111. `album`.`strImage` AS `strImage`,
  1112. `album`.`iRating` AS `iRating`,
  1113. `album`.`bCompilation` AS `bCompilation`,min(`song`.`iTimesPlayed`) AS `iTimesPlayed`
  1114. FROM (`c48`.`album` left join `c48`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1115.  
  1116. CREATE VIEW `c48`.`artistview`
  1117. AS SELECT
  1118. `artist`.`idArtist` AS `idArtist`,
  1119. `artist`.`strArtist` AS `strArtist`,
  1120. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1121. `artist`.`strBorn` AS `strBorn`,
  1122. `artist`.`strFormed` AS `strFormed`,
  1123. `artist`.`strGenres` AS `strGenres`,
  1124. `artist`.`strMoods` AS `strMoods`,
  1125. `artist`.`strStyles` AS `strStyles`,
  1126. `artist`.`strInstruments` AS `strInstruments`,
  1127. `artist`.`strBiography` AS `strBiography`,
  1128. `artist`.`strDied` AS `strDied`,
  1129. `artist`.`strDisbanded` AS `strDisbanded`,
  1130. `artist`.`strYearsActive` AS `strYearsActive`,
  1131. `artist`.`strImage` AS `strImage`,
  1132. `artist`.`strFanart` AS `strFanart`
  1133. FROM `c48`.`artist`;
  1134.  
  1135. CREATE VIEW `c48`.`songartistview`
  1136. AS SELECT
  1137. `song_artist`.`idSong` AS `idSong`,
  1138. `song_artist`.`idArtist` AS `idArtist`,
  1139. `artist`.`strArtist` AS `strArtist`,
  1140. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1141. `song_artist`.`boolFeatured` AS `boolFeatured`,
  1142. `song_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1143. `song_artist`.`iOrder` AS `iOrder`
  1144. FROM (`c48`.`song_artist` join `c48`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1145.  
  1146. CREATE VIEW `c48`.`songview`
  1147. AS SELECT
  1148. `song`.`idSong` AS `idSong`,
  1149. `song`.`strArtists` AS `strArtists`,
  1150. `song`.`strGenres` AS `strGenres`,
  1151. `song`.`strTitle` AS `strTitle`,
  1152. `song`.`iTrack` AS `iTrack`,
  1153. `song`.`iDuration` AS `iDuration`,
  1154. `song`.`iYear` AS `iYear`,
  1155. `song`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1156. `song`.`strFileName` AS `strFileName`,
  1157. `song`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1158. `song`.`iTimesPlayed` AS `iTimesPlayed`,
  1159. `song`.`iStartOffset` AS `iStartOffset`,
  1160. `song`.`iEndOffset` AS `iEndOffset`,
  1161. `song`.`lastplayed` AS `lastplayed`,
  1162. `song`.`rating` AS `rating`,
  1163. `song`.`comment` AS `comment`,
  1164. `song`.`idAlbum` AS `idAlbum`,
  1165. `album`.`strAlbum` AS `strAlbum`,
  1166. `path`.`strPath` AS `strPath`,
  1167. `karaokedata`.`iKaraNumber` AS `iKaraNumber`,
  1168. `karaokedata`.`iKaraDelay` AS `iKaraDelay`,
  1169. `karaokedata`.`strKaraEncoding` AS `strKaraEncoding`,
  1170. `album`.`bCompilation` AS `bCompilation`,
  1171. `album`.`strArtists` AS `strAlbumArtists`
  1172. FROM (((`c48`.`song` join `c48`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `c48`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `c48`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1173.  
  1174. CREATE DATABASE d48;
  1175. CREATE VIEW `d48`.`album` AS SELECT * FROM `a48`.`album`;
  1176. CREATE VIEW `d48`.`album_artist` AS SELECT * FROM `a48`.`album_artist`;
  1177. CREATE VIEW `d48`.`album_genre` AS SELECT * FROM `a48`.`album_genre`;
  1178. CREATE VIEW `d48`.`albuminfosong` AS SELECT * FROM `a48`.`albuminfosong`;
  1179. CREATE VIEW `d48`.`art` AS SELECT * FROM `a48`.`art`;
  1180. CREATE VIEW `d48`.`artist` AS SELECT * FROM `a48`.`artist`;
  1181. CREATE VIEW `d48`.`content` AS SELECT * FROM `a48`.`content`;
  1182. CREATE VIEW `d48`.`discography` AS SELECT * FROM `a48`.`discography`;
  1183. CREATE VIEW `d48`.`genre` AS SELECT * FROM `a48`.`genre`;
  1184. CREATE VIEW `d48`.`karaokedata` AS SELECT * FROM `a48`.`karaokedata`;
  1185. CREATE VIEW `d48`.`path` AS SELECT * FROM `a48`.`path`;
  1186. CREATE VIEW `d48`.`song_artist` AS SELECT * FROM `a48`.`song_artist`;
  1187. CREATE VIEW `d48`.`song_genre` AS SELECT * FROM `a48`.`song_genre`;
  1188. CREATE VIEW `d48`.`version` AS SELECT * FROM `a48`.`version`;
  1189.  
  1190. CREATE VIEW `d48`.`song`
  1191. AS SELECT
  1192. `a48`.`globalsong`.`idSong` AS `idSong`,
  1193. `a48`.`globalsong`.`idAlbum` AS `idAlbum`,
  1194. `a48`.`globalsong`.`idPath` AS `idPath`,
  1195. `a48`.`globalsong`.`strArtists` AS `strArtists`,
  1196. `a48`.`globalsong`.`strGenres` AS `strGenres`,
  1197. `a48`.`globalsong`.`strTitle` AS `strTitle`,
  1198. `a48`.`globalsong`.`iTrack` AS `iTrack`,
  1199. `a48`.`globalsong`.`iDuration` AS `iDuration`,
  1200. `a48`.`globalsong`.`iYear` AS `iYear`,
  1201. `a48`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1202. `a48`.`globalsong`.`strFileName` AS `strFileName`,
  1203. `a48`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1204. `a48`.`globalsong`.`iTimesPlayed4` AS `iTimesPlayed`,
  1205. `a48`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1206. `a48`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1207. `a48`.`globalsong`.`idThumb` AS `idThumb`,
  1208. `a48`.`globalsong`.`lastplayed4` AS `lastplayed`,
  1209. `a48`.`globalsong`.`comment` AS `comment`,
  1210. `a48`.`globalsong`.`rating` AS `rating`
  1211. FROM `a48`.`globalsong`;
  1212.  
  1213. CREATE VIEW `d48`.`albumartistview`
  1214. AS SELECT
  1215. `album_artist`.`idAlbum` AS `idAlbum`,
  1216. `album_artist`.`idArtist` AS `idArtist`,
  1217. `artist`.`strArtist` AS `strArtist`,
  1218. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1219. `album_artist`.`boolFeatured` AS `boolFeatured`,
  1220. `album_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1221. `album_artist`.`iOrder` AS `iOrder`
  1222. FROM (`d48`.`album_artist` join `d48`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1223.  
  1224. CREATE VIEW `d48`.`albumview`
  1225. AS SELECT
  1226. `album`.`idAlbum` AS `idAlbum`,
  1227. `album`.`strAlbum` AS `strAlbum`,
  1228. `album`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,
  1229. `album`.`strArtists` AS `strArtists`,
  1230. `album`.`strGenres` AS `strGenres`,
  1231. `album`.`iYear` AS `iYear`,
  1232. `album`.`strMoods` AS `strMoods`,
  1233. `album`.`strStyles` AS `strStyles`,
  1234. `album`.`strThemes` AS `strThemes`,
  1235. `album`.`strReview` AS `strReview`,
  1236. `album`.`strLabel` AS `strLabel`,
  1237. `album`.`strType` AS `strType`,
  1238. `album`.`strImage` AS `strImage`,
  1239. `album`.`iRating` AS `iRating`,
  1240. `album`.`bCompilation` AS `bCompilation`,min(`song`.`iTimesPlayed`) AS `iTimesPlayed`
  1241. FROM (`d48`.`album` left join `d48`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1242.  
  1243. CREATE VIEW `d48`.`artistview`
  1244. AS SELECT
  1245. `artist`.`idArtist` AS `idArtist`,
  1246. `artist`.`strArtist` AS `strArtist`,
  1247. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1248. `artist`.`strBorn` AS `strBorn`,
  1249. `artist`.`strFormed` AS `strFormed`,
  1250. `artist`.`strGenres` AS `strGenres`,
  1251. `artist`.`strMoods` AS `strMoods`,
  1252. `artist`.`strStyles` AS `strStyles`,
  1253. `artist`.`strInstruments` AS `strInstruments`,
  1254. `artist`.`strBiography` AS `strBiography`,
  1255. `artist`.`strDied` AS `strDied`,
  1256. `artist`.`strDisbanded` AS `strDisbanded`,
  1257. `artist`.`strYearsActive` AS `strYearsActive`,
  1258. `artist`.`strImage` AS `strImage`,
  1259. `artist`.`strFanart` AS `strFanart`
  1260. FROM `d48`.`artist`;
  1261.  
  1262. CREATE VIEW `d48`.`songartistview`
  1263. AS SELECT
  1264. `song_artist`.`idSong` AS `idSong`,
  1265. `song_artist`.`idArtist` AS `idArtist`,
  1266. `artist`.`strArtist` AS `strArtist`,
  1267. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1268. `song_artist`.`boolFeatured` AS `boolFeatured`,
  1269. `song_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1270. `song_artist`.`iOrder` AS `iOrder`
  1271. FROM (`d48`.`song_artist` join `d48`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1272.  
  1273. CREATE VIEW `d48`.`songview`
  1274. AS SELECT
  1275. `song`.`idSong` AS `idSong`,
  1276. `song`.`strArtists` AS `strArtists`,
  1277. `song`.`strGenres` AS `strGenres`,
  1278. `song`.`strTitle` AS `strTitle`,
  1279. `song`.`iTrack` AS `iTrack`,
  1280. `song`.`iDuration` AS `iDuration`,
  1281. `song`.`iYear` AS `iYear`,
  1282. `song`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1283. `song`.`strFileName` AS `strFileName`,
  1284. `song`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1285. `song`.`iTimesPlayed` AS `iTimesPlayed`,
  1286. `song`.`iStartOffset` AS `iStartOffset`,
  1287. `song`.`iEndOffset` AS `iEndOffset`,
  1288. `song`.`lastplayed` AS `lastplayed`,
  1289. `song`.`rating` AS `rating`,
  1290. `song`.`comment` AS `comment`,
  1291. `song`.`idAlbum` AS `idAlbum`,
  1292. `album`.`strAlbum` AS `strAlbum`,
  1293. `path`.`strPath` AS `strPath`,
  1294. `karaokedata`.`iKaraNumber` AS `iKaraNumber`,
  1295. `karaokedata`.`iKaraDelay` AS `iKaraDelay`,
  1296. `karaokedata`.`strKaraEncoding` AS `strKaraEncoding`,
  1297. `album`.`bCompilation` AS `bCompilation`,
  1298. `album`.`strArtists` AS `strAlbumArtists`
  1299. FROM (((`d48`.`song` join `d48`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `d48`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `d48`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1300.  
  1301. CREATE DATABASE e48;
  1302. CREATE VIEW `e48`.`album` AS SELECT * FROM `a48`.`album`;
  1303. CREATE VIEW `e48`.`album_artist` AS SELECT * FROM `a48`.`album_artist`;
  1304. CREATE VIEW `e48`.`album_genre` AS SELECT * FROM `a48`.`album_genre`;
  1305. CREATE VIEW `e48`.`albuminfosong` AS SELECT * FROM `a48`.`albuminfosong`;
  1306. CREATE VIEW `e48`.`art` AS SELECT * FROM `a48`.`art`;
  1307. CREATE VIEW `e48`.`artist` AS SELECT * FROM `a48`.`artist`;
  1308. CREATE VIEW `e48`.`content` AS SELECT * FROM `a48`.`content`;
  1309. CREATE VIEW `e48`.`discography` AS SELECT * FROM `a48`.`discography`;
  1310. CREATE VIEW `e48`.`genre` AS SELECT * FROM `a48`.`genre`;
  1311. CREATE VIEW `e48`.`karaokedata` AS SELECT * FROM `a48`.`karaokedata`;
  1312. CREATE VIEW `e48`.`path` AS SELECT * FROM `a48`.`path`;
  1313. CREATE VIEW `e48`.`song_artist` AS SELECT * FROM `a48`.`song_artist`;
  1314. CREATE VIEW `e48`.`song_genre` AS SELECT * FROM `a48`.`song_genre`;
  1315. CREATE VIEW `e48`.`version` AS SELECT * FROM `a48`.`version`;
  1316.  
  1317. CREATE VIEW `e48`.`song`
  1318. AS SELECT
  1319. `a48`.`globalsong`.`idSong` AS `idSong`,
  1320. `a48`.`globalsong`.`idAlbum` AS `idAlbum`,
  1321. `a48`.`globalsong`.`idPath` AS `idPath`,
  1322. `a48`.`globalsong`.`strArtists` AS `strArtists`,
  1323. `a48`.`globalsong`.`strGenres` AS `strGenres`,
  1324. `a48`.`globalsong`.`strTitle` AS `strTitle`,
  1325. `a48`.`globalsong`.`iTrack` AS `iTrack`,
  1326. `a48`.`globalsong`.`iDuration` AS `iDuration`,
  1327. `a48`.`globalsong`.`iYear` AS `iYear`,
  1328. `a48`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1329. `a48`.`globalsong`.`strFileName` AS `strFileName`,
  1330. `a48`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1331. `a48`.`globalsong`.`iTimesPlayed5` AS `iTimesPlayed`,
  1332. `a48`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1333. `a48`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1334. `a48`.`globalsong`.`idThumb` AS `idThumb`,
  1335. `a48`.`globalsong`.`lastplayed5` AS `lastplayed`,
  1336. `a48`.`globalsong`.`comment` AS `comment`,
  1337. `a48`.`globalsong`.`rating` AS `rating`
  1338. FROM `a48`.`globalsong`;
  1339.  
  1340. CREATE VIEW `e48`.`albumartistview`
  1341. AS SELECT
  1342. `album_artist`.`idAlbum` AS `idAlbum`,
  1343. `album_artist`.`idArtist` AS `idArtist`,
  1344. `artist`.`strArtist` AS `strArtist`,
  1345. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1346. `album_artist`.`boolFeatured` AS `boolFeatured`,
  1347. `album_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1348. `album_artist`.`iOrder` AS `iOrder`
  1349. FROM (`e48`.`album_artist` join `e48`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1350.  
  1351. CREATE VIEW `e48`.`albumview`
  1352. AS SELECT
  1353. `album`.`idAlbum` AS `idAlbum`,
  1354. `album`.`strAlbum` AS `strAlbum`,
  1355. `album`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,
  1356. `album`.`strArtists` AS `strArtists`,
  1357. `album`.`strGenres` AS `strGenres`,
  1358. `album`.`iYear` AS `iYear`,
  1359. `album`.`strMoods` AS `strMoods`,
  1360. `album`.`strStyles` AS `strStyles`,
  1361. `album`.`strThemes` AS `strThemes`,
  1362. `album`.`strReview` AS `strReview`,
  1363. `album`.`strLabel` AS `strLabel`,
  1364. `album`.`strType` AS `strType`,
  1365. `album`.`strImage` AS `strImage`,
  1366. `album`.`iRating` AS `iRating`,
  1367. `album`.`bCompilation` AS `bCompilation`,min(`song`.`iTimesPlayed`) AS `iTimesPlayed`
  1368. FROM (`e48`.`album` left join `e48`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1369.  
  1370. CREATE VIEW `e48`.`artistview`
  1371. AS SELECT
  1372. `artist`.`idArtist` AS `idArtist`,
  1373. `artist`.`strArtist` AS `strArtist`,
  1374. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1375. `artist`.`strBorn` AS `strBorn`,
  1376. `artist`.`strFormed` AS `strFormed`,
  1377. `artist`.`strGenres` AS `strGenres`,
  1378. `artist`.`strMoods` AS `strMoods`,
  1379. `artist`.`strStyles` AS `strStyles`,
  1380. `artist`.`strInstruments` AS `strInstruments`,
  1381. `artist`.`strBiography` AS `strBiography`,
  1382. `artist`.`strDied` AS `strDied`,
  1383. `artist`.`strDisbanded` AS `strDisbanded`,
  1384. `artist`.`strYearsActive` AS `strYearsActive`,
  1385. `artist`.`strImage` AS `strImage`,
  1386. `artist`.`strFanart` AS `strFanart`
  1387. FROM `e48`.`artist`;
  1388.  
  1389. CREATE VIEW `e48`.`songartistview`
  1390. AS SELECT
  1391. `song_artist`.`idSong` AS `idSong`,
  1392. `song_artist`.`idArtist` AS `idArtist`,
  1393. `artist`.`strArtist` AS `strArtist`,
  1394. `artist`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,
  1395. `song_artist`.`boolFeatured` AS `boolFeatured`,
  1396. `song_artist`.`strJoinPhrase` AS `strJoinPhrase`,
  1397. `song_artist`.`iOrder` AS `iOrder`
  1398. FROM (`e48`.`song_artist` join `e48`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1399.  
  1400. CREATE VIEW `e48`.`songview`
  1401. AS SELECT
  1402. `song`.`idSong` AS `idSong`,
  1403. `song`.`strArtists` AS `strArtists`,
  1404. `song`.`strGenres` AS `strGenres`,
  1405. `song`.`strTitle` AS `strTitle`,
  1406. `song`.`iTrack` AS `iTrack`,
  1407. `song`.`iDuration` AS `iDuration`,
  1408. `song`.`iYear` AS `iYear`,
  1409. `song`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1410. `song`.`strFileName` AS `strFileName`,
  1411. `song`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1412. `song`.`iTimesPlayed` AS `iTimesPlayed`,
  1413. `song`.`iStartOffset` AS `iStartOffset`,
  1414. `song`.`iEndOffset` AS `iEndOffset`,
  1415. `song`.`lastplayed` AS `lastplayed`,
  1416. `song`.`rating` AS `rating`,
  1417. `song`.`comment` AS `comment`,
  1418. `song`.`idAlbum` AS `idAlbum`,
  1419. `album`.`strAlbum` AS `strAlbum`,
  1420. `path`.`strPath` AS `strPath`,
  1421. `karaokedata`.`iKaraNumber` AS `iKaraNumber`,
  1422. `karaokedata`.`iKaraDelay` AS `iKaraDelay`,
  1423. `karaokedata`.`strKaraEncoding` AS `strKaraEncoding`,
  1424. `album`.`bCompilation` AS `bCompilation`,
  1425. `album`.`strArtists` AS `strAlbumArtists`
  1426. FROM (((`e48`.`song` join `e48`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `e48`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `e48`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement