Guest User

5 User XBMC - SQL Setup 1.2

a guest
Jun 6th, 2014
1,520
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RENAME TABLE `a78`.`files` to `a78`.`globalfiles`;
  2.  
  3. ALTER TABLE `a78`.`globalfiles` CHANGE playCount PlayCount1 INT;
  4. ALTER TABLE `a78`.`globalfiles` CHANGE lastPlayed lastPlayed1 TEXT;
  5. ALTER TABLE `a78`.`globalfiles` ADD playCount2 INT(11) AFTER lastPlayed1;
  6. ALTER TABLE `a78`.`globalfiles` ADD lastPlayed2 TEXT AFTER playCount2;
  7. ALTER TABLE `a78`.`globalfiles` ADD playCount3 INT(11) AFTER lastPlayed2;
  8. ALTER TABLE `a78`.`globalfiles` ADD lastPlayed3 TEXT AFTER playCount3;
  9. ALTER TABLE `a78`.`globalfiles` ADD playCount4 INT(11) AFTER lastPlayed3;
  10. ALTER TABLE `a78`.`globalfiles` ADD lastPlayed4 TEXT AFTER playCount4;
  11. ALTER TABLE `a78`.`globalfiles` ADD playCount5 INT(11) AFTER lastPlayed4;
  12. ALTER TABLE `a78`.`globalfiles` ADD lastPlayed5 TEXT AFTER playCount5;
  13.  
  14. CREATE VIEW `a78`.`files`
  15. AS SELECT
  16. `a78`.`globalfiles`.`idFile` AS `idFile`,
  17. `a78`.`globalfiles`.`idPath` AS `idPath`,
  18. `a78`.`globalfiles`.`strFilename` AS `strFilename`,
  19. `a78`.`globalfiles`.`playCount1` AS `playCount`,
  20. `a78`.`globalfiles`.`lastPlayed1` AS `lastPlayed`,
  21. `a78`.`globalfiles`.`dateAdded` AS `dateAdded`
  22. FROM `a78`.`globalfiles`;
  23.  
  24. CREATE DATABASE b78;
  25.  
  26. CREATE VIEW `b78`.`actorlinkepisode` AS SELECT * FROM `a78`.`actorlinkepisode`;
  27. CREATE VIEW `b78`.`actorlinkmovie` AS SELECT * FROM `a78`.`actorlinkmovie`;
  28. CREATE VIEW `b78`.`actorlinktvshow` AS SELECT * FROM `a78`.`actorlinktvshow`;
  29. CREATE VIEW `b78`.`actors` AS SELECT * FROM `a78`.`actors`;
  30. CREATE VIEW `b78`.`art` AS SELECT * FROM `a78`.`art`;
  31. CREATE VIEW `b78`.`artistlinkmusicvideo` AS SELECT * FROM `a78`.`artistlinkmusicvideo`;
  32. CREATE VIEW `b78`.`country` AS SELECT * FROM `a78`.`country`;
  33. CREATE VIEW `b78`.`countrylinkmovie` AS SELECT * FROM `a78`.`countrylinkmovie`;
  34. CREATE VIEW `b78`.`directorlinkepisode` AS SELECT * FROM `a78`.`directorlinkepisode`;
  35. CREATE VIEW `b78`.`directorlinkmovie` AS SELECT * FROM `a78`.`directorlinkmovie`;
  36. CREATE VIEW `b78`.`directorlinkmusicvideo` AS SELECT * FROM `a78`.`directorlinkmusicvideo`;
  37. CREATE VIEW `b78`.`directorlinktvshow` AS SELECT * FROM `a78`.`directorlinktvshow`;
  38. CREATE VIEW `b78`.`episode` AS SELECT * FROM `a78`.`episode`;
  39. CREATE VIEW `b78`.`genre` AS SELECT * FROM `a78`.`genre`;
  40. CREATE VIEW `b78`.`genrelinkmovie` AS SELECT * FROM `a78`.`genrelinkmovie`;
  41. CREATE VIEW `b78`.`genrelinkmusicvideo` AS SELECT * FROM `a78`.`genrelinkmusicvideo`;
  42. CREATE VIEW `b78`.`genrelinktvshow` AS SELECT * FROM `a78`.`genrelinktvshow`;
  43. CREATE VIEW `b78`.`movie` AS SELECT * FROM `a78`.`movie`;
  44. CREATE VIEW `b78`.`movielinktvshow` AS SELECT * FROM `a78`.`movielinktvshow`;
  45. CREATE VIEW `b78`.`musicvideo` AS SELECT * FROM `a78`.`musicvideo`;
  46. CREATE VIEW `b78`.`path` AS SELECT * FROM `a78`.`path`;
  47. CREATE VIEW `b78`.`seasons` AS SELECT * FROM `a78`.`seasons`;
  48. CREATE VIEW `b78`.`sets` AS SELECT * FROM `a78`.`sets`;
  49. CREATE VIEW `b78`.`settings` AS SELECT * FROM `a78`.`settings`;
  50. CREATE VIEW `b78`.`stacktimes` AS SELECT * FROM `a78`.`stacktimes`;
  51. CREATE VIEW `b78`.`streamdetails` AS SELECT * FROM `a78`.`streamdetails`;
  52. CREATE VIEW `b78`.`studio` AS SELECT * FROM `a78`.`studio`;
  53. CREATE VIEW `b78`.`studiolinkmovie` AS SELECT * FROM `a78`.`studiolinkmovie`;
  54. CREATE VIEW `b78`.`studiolinkmusicvideo` AS SELECT * FROM `a78`.`studiolinkmusicvideo`;
  55. CREATE VIEW `b78`.`studiolinktvshow` AS SELECT * FROM `a78`.`studiolinktvshow`;
  56. CREATE VIEW `b78`.`tag` AS SELECT * FROM `a78`.`tag`;
  57. CREATE VIEW `b78`.`taglinks` AS SELECT * FROM `a78`.`taglinks`;
  58. CREATE VIEW `b78`.`tvshow` AS SELECT * FROM `a78`.`tvshow`;
  59. CREATE VIEW `b78`.`tvshowlinkpath` AS SELECT * FROM `a78`.`tvshowlinkpath`;
  60. CREATE VIEW `b78`.`version` AS SELECT * FROM `a78`.`version`;
  61. CREATE VIEW `b78`.`writerlinkepisode` AS SELECT * FROM `a78`.`writerlinkepisode`;
  62. CREATE VIEW `b78`.`writerlinkmovie` AS SELECT * FROM `a78`.`writerlinkmovie`;
  63.  
  64. CREATE VIEW `b78`.`files`
  65. AS SELECT
  66. `a78`.`globalfiles`.`idFile` AS `idFile`,
  67. `a78`.`globalfiles`.`idPath` AS `idPath`,
  68. `a78`.`globalfiles`.`strFilename` AS `strFilename`,
  69. `a78`.`globalfiles`.`playCount2` AS `playCount`,
  70. `a78`.`globalfiles`.`lastPlayed2` AS `lastPlayed`,
  71. `a78`.`globalfiles`.`dateAdded` AS `dateAdded`
  72. FROM `a78`.`globalfiles`;
  73.  
  74. CREATE TABLE `b78`.`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 `b78`.`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. `b78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  127. `b78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  128. `seasons`.`idSeason` AS `idSeason`
  129. FROM (((((`b78`.`episode` join `b78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `b78`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `b78`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `b78`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `b78`.`bookmark` on(((`b78`.`bookmark`.`idFile` = `episode`.`idFile`) and (`b78`.`bookmark`.`type` = 1))));
  130.  
  131. CREATE VIEW `b78`.`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. `b78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  167. `b78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  168. FROM ((((`b78`.`movie` left join `b78`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `b78`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `b78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `b78`.`bookmark` on(((`b78`.`bookmark`.`idFile` = `movie`.`idFile`) and (`b78`.`bookmark`.`type` = 1))));
  169.  
  170. CREATE VIEW `b78`.`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. `b78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  204. `b78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  205. FROM (((`b78`.`musicvideo` join `b78`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `b78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `b78`.`bookmark` on(((`b78`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`b78`.`bookmark`.`type` = 1))));
  206.  
  207. CREATE VIEW `b78`.`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 ((((`b78`.`tvshow` left join `b78`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `b78`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `b78`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `b78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  237.  
  238. CREATE DATABASE c78;
  239.  
  240. CREATE VIEW `c78`.`actorlinkepisode` AS SELECT * FROM `a78`.`actorlinkepisode`;
  241. CREATE VIEW `c78`.`actorlinkmovie` AS SELECT * FROM `a78`.`actorlinkmovie`;
  242. CREATE VIEW `c78`.`actorlinktvshow` AS SELECT * FROM `a78`.`actorlinktvshow`;
  243. CREATE VIEW `c78`.`actors` AS SELECT * FROM `a78`.`actors`;
  244. CREATE VIEW `c78`.`art` AS SELECT * FROM `a78`.`art`;
  245. CREATE VIEW `c78`.`artistlinkmusicvideo` AS SELECT * FROM `a78`.`artistlinkmusicvideo`;
  246. CREATE VIEW `c78`.`country` AS SELECT * FROM `a78`.`country`;
  247. CREATE VIEW `c78`.`countrylinkmovie` AS SELECT * FROM `a78`.`countrylinkmovie`;
  248. CREATE VIEW `c78`.`directorlinkepisode` AS SELECT * FROM `a78`.`directorlinkepisode`;
  249. CREATE VIEW `c78`.`directorlinkmovie` AS SELECT * FROM `a78`.`directorlinkmovie`;
  250. CREATE VIEW `c78`.`directorlinkmusicvideo` AS SELECT * FROM `a78`.`directorlinkmusicvideo`;
  251. CREATE VIEW `c78`.`directorlinktvshow` AS SELECT * FROM `a78`.`directorlinktvshow`;
  252. CREATE VIEW `c78`.`episode` AS SELECT * FROM `a78`.`episode`;
  253. CREATE VIEW `c78`.`genre` AS SELECT * FROM `a78`.`genre`;
  254. CREATE VIEW `c78`.`genrelinkmovie` AS SELECT * FROM `a78`.`genrelinkmovie`;
  255. CREATE VIEW `c78`.`genrelinkmusicvideo` AS SELECT * FROM `a78`.`genrelinkmusicvideo`;
  256. CREATE VIEW `c78`.`genrelinktvshow` AS SELECT * FROM `a78`.`genrelinktvshow`;
  257. CREATE VIEW `c78`.`movie` AS SELECT * FROM `a78`.`movie`;
  258. CREATE VIEW `c78`.`movielinktvshow` AS SELECT * FROM `a78`.`movielinktvshow`;
  259. CREATE VIEW `c78`.`musicvideo` AS SELECT * FROM `a78`.`musicvideo`;
  260. CREATE VIEW `c78`.`path` AS SELECT * FROM `a78`.`path`;
  261. CREATE VIEW `c78`.`seasons` AS SELECT * FROM `a78`.`seasons`;
  262. CREATE VIEW `c78`.`sets` AS SELECT * FROM `a78`.`sets`;
  263. CREATE VIEW `c78`.`settings` AS SELECT * FROM `a78`.`settings`;
  264. CREATE VIEW `c78`.`stacktimes` AS SELECT * FROM `a78`.`stacktimes`;
  265. CREATE VIEW `c78`.`streamdetails` AS SELECT * FROM `a78`.`streamdetails`;
  266. CREATE VIEW `c78`.`studio` AS SELECT * FROM `a78`.`studio`;
  267. CREATE VIEW `c78`.`studiolinkmovie` AS SELECT * FROM `a78`.`studiolinkmovie`;
  268. CREATE VIEW `c78`.`studiolinkmusicvideo` AS SELECT * FROM `a78`.`studiolinkmusicvideo`;
  269. CREATE VIEW `c78`.`studiolinktvshow` AS SELECT * FROM `a78`.`studiolinktvshow`;
  270. CREATE VIEW `c78`.`tag` AS SELECT * FROM `a78`.`tag`;
  271. CREATE VIEW `c78`.`taglinks` AS SELECT * FROM `a78`.`taglinks`;
  272. CREATE VIEW `c78`.`tvshow` AS SELECT * FROM `a78`.`tvshow`;
  273. CREATE VIEW `c78`.`tvshowlinkpath` AS SELECT * FROM `a78`.`tvshowlinkpath`;
  274. CREATE VIEW `c78`.`version` AS SELECT * FROM `a78`.`version`;
  275. CREATE VIEW `c78`.`writerlinkepisode` AS SELECT * FROM `a78`.`writerlinkepisode`;
  276. CREATE VIEW `c78`.`writerlinkmovie` AS SELECT * FROM `a78`.`writerlinkmovie`;
  277.  
  278. CREATE VIEW `c78`.`files`
  279. AS SELECT
  280. `a78`.`globalfiles`.`idFile` AS `idFile`,
  281. `a78`.`globalfiles`.`idPath` AS `idPath`,
  282. `a78`.`globalfiles`.`strFilename` AS `strFilename`,
  283. `a78`.`globalfiles`.`playCount3` AS `playCount`,
  284. `a78`.`globalfiles`.`lastPlayed3` AS `lastPlayed`,
  285. `a78`.`globalfiles`.`dateAdded` AS `dateAdded`
  286. FROM `a78`.`globalfiles`;
  287.  
  288. CREATE TABLE `c78`.`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 `c78`.`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. `c78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  341. `c78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  342. `seasons`.`idSeason` AS `idSeason`
  343. FROM (((((`c78`.`episode` join `c78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `c78`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `c78`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `c78`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `c78`.`bookmark` on(((`c78`.`bookmark`.`idFile` = `episode`.`idFile`) and (`c78`.`bookmark`.`type` = 1))));
  344.  
  345. CREATE VIEW `c78`.`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. `c78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  381. `c78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  382. FROM ((((`c78`.`movie` left join `c78`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `c78`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `c78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `c78`.`bookmark` on(((`c78`.`bookmark`.`idFile` = `movie`.`idFile`) and (`c78`.`bookmark`.`type` = 1))));
  383.  
  384. CREATE VIEW `c78`.`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. `c78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  418. `c78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  419. FROM (((`c78`.`musicvideo` join `c78`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `c78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `c78`.`bookmark` on(((`c78`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`c78`.`bookmark`.`type` = 1))));
  420.  
  421. CREATE VIEW `c78`.`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 ((((`c78`.`tvshow` left join `c78`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `c78`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `c78`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `c78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  451.  
  452. CREATE DATABASE d78;
  453.  
  454. CREATE VIEW `d78`.`actorlinkepisode` AS SELECT * FROM `a78`.`actorlinkepisode`;
  455. CREATE VIEW `d78`.`actorlinkmovie` AS SELECT * FROM `a78`.`actorlinkmovie`;
  456. CREATE VIEW `d78`.`actorlinktvshow` AS SELECT * FROM `a78`.`actorlinktvshow`;
  457. CREATE VIEW `d78`.`actors` AS SELECT * FROM `a78`.`actors`;
  458. CREATE VIEW `d78`.`art` AS SELECT * FROM `a78`.`art`;
  459. CREATE VIEW `d78`.`artistlinkmusicvideo` AS SELECT * FROM `a78`.`artistlinkmusicvideo`;
  460. CREATE VIEW `d78`.`country` AS SELECT * FROM `a78`.`country`;
  461. CREATE VIEW `d78`.`countrylinkmovie` AS SELECT * FROM `a78`.`countrylinkmovie`;
  462. CREATE VIEW `d78`.`directorlinkepisode` AS SELECT * FROM `a78`.`directorlinkepisode`;
  463. CREATE VIEW `d78`.`directorlinkmovie` AS SELECT * FROM `a78`.`directorlinkmovie`;
  464. CREATE VIEW `d78`.`directorlinkmusicvideo` AS SELECT * FROM `a78`.`directorlinkmusicvideo`;
  465. CREATE VIEW `d78`.`directorlinktvshow` AS SELECT * FROM `a78`.`directorlinktvshow`;
  466. CREATE VIEW `d78`.`episode` AS SELECT * FROM `a78`.`episode`;
  467. CREATE VIEW `d78`.`genre` AS SELECT * FROM `a78`.`genre`;
  468. CREATE VIEW `d78`.`genrelinkmovie` AS SELECT * FROM `a78`.`genrelinkmovie`;
  469. CREATE VIEW `d78`.`genrelinkmusicvideo` AS SELECT * FROM `a78`.`genrelinkmusicvideo`;
  470. CREATE VIEW `d78`.`genrelinktvshow` AS SELECT * FROM `a78`.`genrelinktvshow`;
  471. CREATE VIEW `d78`.`movie` AS SELECT * FROM `a78`.`movie`;
  472. CREATE VIEW `d78`.`movielinktvshow` AS SELECT * FROM `a78`.`movielinktvshow`;
  473. CREATE VIEW `d78`.`musicvideo` AS SELECT * FROM `a78`.`musicvideo`;
  474. CREATE VIEW `d78`.`path` AS SELECT * FROM `a78`.`path`;
  475. CREATE VIEW `d78`.`seasons` AS SELECT * FROM `a78`.`seasons`;
  476. CREATE VIEW `d78`.`sets` AS SELECT * FROM `a78`.`sets`;
  477. CREATE VIEW `d78`.`settings` AS SELECT * FROM `a78`.`settings`;
  478. CREATE VIEW `d78`.`stacktimes` AS SELECT * FROM `a78`.`stacktimes`;
  479. CREATE VIEW `d78`.`streamdetails` AS SELECT * FROM `a78`.`streamdetails`;
  480. CREATE VIEW `d78`.`studio` AS SELECT * FROM `a78`.`studio`;
  481. CREATE VIEW `d78`.`studiolinkmovie` AS SELECT * FROM `a78`.`studiolinkmovie`;
  482. CREATE VIEW `d78`.`studiolinkmusicvideo` AS SELECT * FROM `a78`.`studiolinkmusicvideo`;
  483. CREATE VIEW `d78`.`studiolinktvshow` AS SELECT * FROM `a78`.`studiolinktvshow`;
  484. CREATE VIEW `d78`.`tag` AS SELECT * FROM `a78`.`tag`;
  485. CREATE VIEW `d78`.`taglinks` AS SELECT * FROM `a78`.`taglinks`;
  486. CREATE VIEW `d78`.`tvshow` AS SELECT * FROM `a78`.`tvshow`;
  487. CREATE VIEW `d78`.`tvshowlinkpath` AS SELECT * FROM `a78`.`tvshowlinkpath`;
  488. CREATE VIEW `d78`.`version` AS SELECT * FROM `a78`.`version`;
  489. CREATE VIEW `d78`.`writerlinkepisode` AS SELECT * FROM `a78`.`writerlinkepisode`;
  490. CREATE VIEW `d78`.`writerlinkmovie` AS SELECT * FROM `a78`.`writerlinkmovie`;
  491.  
  492. CREATE VIEW `d78`.`files`
  493. AS SELECT
  494. `a78`.`globalfiles`.`idFile` AS `idFile`,
  495. `a78`.`globalfiles`.`idPath` AS `idPath`,
  496. `a78`.`globalfiles`.`strFilename` AS `strFilename`,
  497. `a78`.`globalfiles`.`playCount4` AS `playCount`,
  498. `a78`.`globalfiles`.`lastPlayed4` AS `lastPlayed`,
  499. `a78`.`globalfiles`.`dateAdded` AS `dateAdded`
  500. FROM `a78`.`globalfiles`;
  501.  
  502. CREATE TABLE `d78`.`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 `d78`.`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. `d78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  555. `d78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  556. `seasons`.`idSeason` AS `idSeason`
  557. FROM (((((`d78`.`episode` join `d78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `d78`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `d78`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `d78`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `d78`.`bookmark` on(((`d78`.`bookmark`.`idFile` = `episode`.`idFile`) and (`d78`.`bookmark`.`type` = 1))));
  558.  
  559. CREATE VIEW `d78`.`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. `d78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  595. `d78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  596. FROM ((((`d78`.`movie` left join `d78`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `d78`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `d78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `d78`.`bookmark` on(((`d78`.`bookmark`.`idFile` = `movie`.`idFile`) and (`d78`.`bookmark`.`type` = 1))));
  597.  
  598. CREATE VIEW `d78`.`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. `d78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  632. `d78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  633. FROM (((`d78`.`musicvideo` join `d78`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `d78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `d78`.`bookmark` on(((`d78`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`d78`.`bookmark`.`type` = 1))));
  634.  
  635. CREATE VIEW `d78`.`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 ((((`d78`.`tvshow` left join `d78`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `d78`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `d78`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `d78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  665.  
  666. CREATE DATABASE e78;
  667.  
  668. CREATE VIEW `e78`.`actorlinkepisode` AS SELECT * FROM `a78`.`actorlinkepisode`;
  669. CREATE VIEW `e78`.`actorlinkmovie` AS SELECT * FROM `a78`.`actorlinkmovie`;
  670. CREATE VIEW `e78`.`actorlinktvshow` AS SELECT * FROM `a78`.`actorlinktvshow`;
  671. CREATE VIEW `e78`.`actors` AS SELECT * FROM `a78`.`actors`;
  672. CREATE VIEW `e78`.`art` AS SELECT * FROM `a78`.`art`;
  673. CREATE VIEW `e78`.`artistlinkmusicvideo` AS SELECT * FROM `a78`.`artistlinkmusicvideo`;
  674. CREATE VIEW `e78`.`country` AS SELECT * FROM `a78`.`country`;
  675. CREATE VIEW `e78`.`countrylinkmovie` AS SELECT * FROM `a78`.`countrylinkmovie`;
  676. CREATE VIEW `e78`.`directorlinkepisode` AS SELECT * FROM `a78`.`directorlinkepisode`;
  677. CREATE VIEW `e78`.`directorlinkmovie` AS SELECT * FROM `a78`.`directorlinkmovie`;
  678. CREATE VIEW `e78`.`directorlinkmusicvideo` AS SELECT * FROM `a78`.`directorlinkmusicvideo`;
  679. CREATE VIEW `e78`.`directorlinktvshow` AS SELECT * FROM `a78`.`directorlinktvshow`;
  680. CREATE VIEW `e78`.`episode` AS SELECT * FROM `a78`.`episode`;
  681. CREATE VIEW `e78`.`genre` AS SELECT * FROM `a78`.`genre`;
  682. CREATE VIEW `e78`.`genrelinkmovie` AS SELECT * FROM `a78`.`genrelinkmovie`;
  683. CREATE VIEW `e78`.`genrelinkmusicvideo` AS SELECT * FROM `a78`.`genrelinkmusicvideo`;
  684. CREATE VIEW `e78`.`genrelinktvshow` AS SELECT * FROM `a78`.`genrelinktvshow`;
  685. CREATE VIEW `e78`.`movie` AS SELECT * FROM `a78`.`movie`;
  686. CREATE VIEW `e78`.`movielinktvshow` AS SELECT * FROM `a78`.`movielinktvshow`;
  687. CREATE VIEW `e78`.`musicvideo` AS SELECT * FROM `a78`.`musicvideo`;
  688. CREATE VIEW `e78`.`path` AS SELECT * FROM `a78`.`path`;
  689. CREATE VIEW `e78`.`seasons` AS SELECT * FROM `a78`.`seasons`;
  690. CREATE VIEW `e78`.`sets` AS SELECT * FROM `a78`.`sets`;
  691. CREATE VIEW `e78`.`settings` AS SELECT * FROM `a78`.`settings`;
  692. CREATE VIEW `e78`.`stacktimes` AS SELECT * FROM `a78`.`stacktimes`;
  693. CREATE VIEW `e78`.`streamdetails` AS SELECT * FROM `a78`.`streamdetails`;
  694. CREATE VIEW `e78`.`studio` AS SELECT * FROM `a78`.`studio`;
  695. CREATE VIEW `e78`.`studiolinkmovie` AS SELECT * FROM `a78`.`studiolinkmovie`;
  696. CREATE VIEW `e78`.`studiolinkmusicvideo` AS SELECT * FROM `a78`.`studiolinkmusicvideo`;
  697. CREATE VIEW `e78`.`studiolinktvshow` AS SELECT * FROM `a78`.`studiolinktvshow`;
  698. CREATE VIEW `e78`.`tag` AS SELECT * FROM `a78`.`tag`;
  699. CREATE VIEW `e78`.`taglinks` AS SELECT * FROM `a78`.`taglinks`;
  700. CREATE VIEW `e78`.`tvshow` AS SELECT * FROM `a78`.`tvshow`;
  701. CREATE VIEW `e78`.`tvshowlinkpath` AS SELECT * FROM `a78`.`tvshowlinkpath`;
  702. CREATE VIEW `e78`.`version` AS SELECT * FROM `a78`.`version`;
  703. CREATE VIEW `e78`.`writerlinkepisode` AS SELECT * FROM `a78`.`writerlinkepisode`;
  704. CREATE VIEW `e78`.`writerlinkmovie` AS SELECT * FROM `a78`.`writerlinkmovie`;
  705.  
  706. CREATE VIEW `e78`.`files`
  707. AS SELECT
  708. `a78`.`globalfiles`.`idFile` AS `idFile`,
  709. `a78`.`globalfiles`.`idPath` AS `idPath`,
  710. `a78`.`globalfiles`.`strFilename` AS `strFilename`,
  711. `a78`.`globalfiles`.`playCount5` AS `playCount`,
  712. `a78`.`globalfiles`.`lastPlayed5` AS `lastPlayed`,
  713. `a78`.`globalfiles`.`dateAdded` AS `dateAdded`
  714. FROM `a78`.`globalfiles`;
  715.  
  716. CREATE TABLE `e78`.`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 `e78`.`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. `e78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  769. `e78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
  770. `seasons`.`idSeason` AS `idSeason`
  771. FROM (((((`e78`.`episode` join `e78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `e78`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `e78`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `e78`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `e78`.`bookmark` on(((`e78`.`bookmark`.`idFile` = `episode`.`idFile`) and (`e78`.`bookmark`.`type` = 1))));
  772.  
  773. CREATE VIEW `e78`.`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. `e78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  809. `e78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  810. FROM ((((`e78`.`movie` left join `e78`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `e78`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `e78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `e78`.`bookmark` on(((`e78`.`bookmark`.`idFile` = `movie`.`idFile`) and (`e78`.`bookmark`.`type` = 1))));
  811.  
  812. CREATE VIEW `e78`.`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. `e78`.`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
  846. `e78`.`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
  847. FROM (((`e78`.`musicvideo` join `e78`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `e78`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `e78`.`bookmark` on(((`e78`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`e78`.`bookmark`.`type` = 1))));
  848.  
  849. CREATE VIEW `e78`.`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 ((((`e78`.`tvshow` left join `e78`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `e78`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `e78`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `e78`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
  879.  
  880.  
  881.  
  882.  
  883.  
  884. RENAME TABLE `a46`.`song` to `a46`.`globalsong`;
  885.  
  886. ALTER TABLE `a46`.`globalsong` CHANGE iTimesPlayed iTimesPlayed1 INT;
  887. ALTER TABLE `a46`.`globalsong` ADD iTimesPlayed2 INT(11) AFTER iTimesPlayed1;
  888. ALTER TABLE `a46`.`globalsong` ADD iTimesPlayed3 INT(11) AFTER iTimesPlayed2;
  889. ALTER TABLE `a46`.`globalsong` ADD iTimesPlayed4 INT(11) AFTER iTimesPlayed3;
  890. ALTER TABLE `a46`.`globalsong` ADD iTimesPlayed5 INT(11) AFTER iTimesPlayed4;
  891. ALTER TABLE `a46`.`globalsong` CHANGE lastPlayed lastPlayed1 VARCHAR(20);
  892. ALTER TABLE `a46`.`globalsong` ADD lastPlayed2 VARCHAR(20) AFTER lastPlayed1;
  893. ALTER TABLE `a46`.`globalsong` ADD lastPlayed3 VARCHAR(20) AFTER lastPlayed2;
  894. ALTER TABLE `a46`.`globalsong` ADD lastPlayed4 VARCHAR(20) AFTER lastPlayed3;
  895. ALTER TABLE `a46`.`globalsong` ADD lastPlayed5 VARCHAR(20) AFTER lastPlayed4;
  896.  
  897. CREATE VIEW `a46`.`song`
  898. AS SELECT
  899. `a46`.`globalsong`.`idSong` AS `idSong`,
  900. `a46`.`globalsong`.`idAlbum` AS `idAlbum`,
  901. `a46`.`globalsong`.`idPath` AS `idPath`,
  902. `a46`.`globalsong`.`strArtists` AS `strArtists`,
  903. `a46`.`globalsong`.`strGenres` AS `strGenres`,
  904. `a46`.`globalsong`.`strTitle` AS `strTitle`,
  905. `a46`.`globalsong`.`iTrack` AS `iTrack`,
  906. `a46`.`globalsong`.`iDuration` AS `iDuration`,
  907. `a46`.`globalsong`.`iYear` AS `iYear`,
  908. `a46`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  909. `a46`.`globalsong`.`strFileName` AS `strFileName`,
  910. `a46`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  911. `a46`.`globalsong`.`iTimesPlayed1` AS `iTimesPlayed`,
  912. `a46`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  913. `a46`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  914. `a46`.`globalsong`.`idThumb` AS `idThumb`,
  915. `a46`.`globalsong`.`lastplayed1` AS `lastplayed`,
  916. `a46`.`globalsong`.`comment` AS `comment`,
  917. `a46`.`globalsong`.`rating` AS `rating`
  918. FROM `a46`.`globalsong`;
  919.  
  920. CREATE DATABASE b46;
  921. CREATE VIEW `b46`.`album` AS SELECT * FROM `a46`.`album`;
  922. CREATE VIEW `b46`.`album_artist` AS SELECT * FROM `a46`.`album_artist`;
  923. CREATE VIEW `b46`.`album_genre` AS SELECT * FROM `a46`.`album_genre`;
  924. CREATE VIEW `b46`.`albuminfosong` AS SELECT * FROM `a46`.`albuminfosong`;
  925. CREATE VIEW `b46`.`art` AS SELECT * FROM `a46`.`art`;
  926. CREATE VIEW `b46`.`artist` AS SELECT * FROM `a46`.`artist`;
  927. CREATE VIEW `b46`.`content` AS SELECT * FROM `a46`.`content`;
  928. CREATE VIEW `b46`.`discography` AS SELECT * FROM `a46`.`discography`;
  929. CREATE VIEW `b46`.`genre` AS SELECT * FROM `a46`.`genre`;
  930. CREATE VIEW `b46`.`karaokedata` AS SELECT * FROM `a46`.`karaokedata`;
  931. CREATE VIEW `b46`.`path` AS SELECT * FROM `a46`.`path`;
  932. CREATE VIEW `b46`.`song_artist` AS SELECT * FROM `a46`.`song_artist`;
  933. CREATE VIEW `b46`.`song_genre` AS SELECT * FROM `a46`.`song_genre`;
  934. CREATE VIEW `b46`.`version` AS SELECT * FROM `a46`.`version`;
  935.  
  936. CREATE VIEW `b46`.`song`
  937. AS SELECT
  938. `a46`.`globalsong`.`idSong` AS `idSong`,
  939. `a46`.`globalsong`.`idAlbum` AS `idAlbum`,
  940. `a46`.`globalsong`.`idPath` AS `idPath`,
  941. `a46`.`globalsong`.`strArtists` AS `strArtists`,
  942. `a46`.`globalsong`.`strGenres` AS `strGenres`,
  943. `a46`.`globalsong`.`strTitle` AS `strTitle`,
  944. `a46`.`globalsong`.`iTrack` AS `iTrack`,
  945. `a46`.`globalsong`.`iDuration` AS `iDuration`,
  946. `a46`.`globalsong`.`iYear` AS `iYear`,
  947. `a46`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  948. `a46`.`globalsong`.`strFileName` AS `strFileName`,
  949. `a46`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  950. `a46`.`globalsong`.`iTimesPlayed2` AS `iTimesPlayed`,
  951. `a46`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  952. `a46`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  953. `a46`.`globalsong`.`idThumb` AS `idThumb`,
  954. `a46`.`globalsong`.`lastplayed2` AS `lastplayed`,
  955. `a46`.`globalsong`.`comment` AS `comment`,
  956. `a46`.`globalsong`.`rating` AS `rating`
  957. FROM `a46`.`globalsong`;
  958.  
  959. CREATE VIEW `b46`.`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 (`b46`.`album_artist` join `b46`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  969.  
  970. CREATE VIEW `b46`.`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 (`b46`.`album` left join `b46`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  988.  
  989. CREATE VIEW `b46`.`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 `b46`.`artist`;
  1007.  
  1008. CREATE VIEW `b46`.`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 (`b46`.`song_artist` join `b46`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1018.  
  1019. CREATE VIEW `b46`.`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 (((`b46`.`song` join `b46`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `b46`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `b46`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1046.  
  1047. CREATE DATABASE c46;
  1048. CREATE VIEW `c46`.`album` AS SELECT * FROM `a46`.`album`;
  1049. CREATE VIEW `c46`.`album_artist` AS SELECT * FROM `a46`.`album_artist`;
  1050. CREATE VIEW `c46`.`album_genre` AS SELECT * FROM `a46`.`album_genre`;
  1051. CREATE VIEW `c46`.`albuminfosong` AS SELECT * FROM `a46`.`albuminfosong`;
  1052. CREATE VIEW `c46`.`art` AS SELECT * FROM `a46`.`art`;
  1053. CREATE VIEW `c46`.`artist` AS SELECT * FROM `a46`.`artist`;
  1054. CREATE VIEW `c46`.`content` AS SELECT * FROM `a46`.`content`;
  1055. CREATE VIEW `c46`.`discography` AS SELECT * FROM `a46`.`discography`;
  1056. CREATE VIEW `c46`.`genre` AS SELECT * FROM `a46`.`genre`;
  1057. CREATE VIEW `c46`.`karaokedata` AS SELECT * FROM `a46`.`karaokedata`;
  1058. CREATE VIEW `c46`.`path` AS SELECT * FROM `a46`.`path`;
  1059. CREATE VIEW `c46`.`song_artist` AS SELECT * FROM `a46`.`song_artist`;
  1060. CREATE VIEW `c46`.`song_genre` AS SELECT * FROM `a46`.`song_genre`;
  1061. CREATE VIEW `c46`.`version` AS SELECT * FROM `a46`.`version`;
  1062.  
  1063. CREATE VIEW `c46`.`song`
  1064. AS SELECT
  1065. `a46`.`globalsong`.`idSong` AS `idSong`,
  1066. `a46`.`globalsong`.`idAlbum` AS `idAlbum`,
  1067. `a46`.`globalsong`.`idPath` AS `idPath`,
  1068. `a46`.`globalsong`.`strArtists` AS `strArtists`,
  1069. `a46`.`globalsong`.`strGenres` AS `strGenres`,
  1070. `a46`.`globalsong`.`strTitle` AS `strTitle`,
  1071. `a46`.`globalsong`.`iTrack` AS `iTrack`,
  1072. `a46`.`globalsong`.`iDuration` AS `iDuration`,
  1073. `a46`.`globalsong`.`iYear` AS `iYear`,
  1074. `a46`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1075. `a46`.`globalsong`.`strFileName` AS `strFileName`,
  1076. `a46`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1077. `a46`.`globalsong`.`iTimesPlayed3` AS `iTimesPlayed`,
  1078. `a46`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1079. `a46`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1080. `a46`.`globalsong`.`idThumb` AS `idThumb`,
  1081. `a46`.`globalsong`.`lastplayed3` AS `lastplayed`,
  1082. `a46`.`globalsong`.`comment` AS `comment`,
  1083. `a46`.`globalsong`.`rating` AS `rating`
  1084. FROM `a46`.`globalsong`;
  1085.  
  1086. CREATE VIEW `c46`.`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 (`c46`.`album_artist` join `c46`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1096.  
  1097. CREATE VIEW `c46`.`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 (`c46`.`album` left join `c46`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1115.  
  1116. CREATE VIEW `c46`.`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 `c46`.`artist`;
  1134.  
  1135. CREATE VIEW `c46`.`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 (`c46`.`song_artist` join `c46`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1145.  
  1146. CREATE VIEW `c46`.`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 (((`c46`.`song` join `c46`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `c46`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `c46`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1173.  
  1174. CREATE DATABASE d46;
  1175. CREATE VIEW `d46`.`album` AS SELECT * FROM `a46`.`album`;
  1176. CREATE VIEW `d46`.`album_artist` AS SELECT * FROM `a46`.`album_artist`;
  1177. CREATE VIEW `d46`.`album_genre` AS SELECT * FROM `a46`.`album_genre`;
  1178. CREATE VIEW `d46`.`albuminfosong` AS SELECT * FROM `a46`.`albuminfosong`;
  1179. CREATE VIEW `d46`.`art` AS SELECT * FROM `a46`.`art`;
  1180. CREATE VIEW `d46`.`artist` AS SELECT * FROM `a46`.`artist`;
  1181. CREATE VIEW `d46`.`content` AS SELECT * FROM `a46`.`content`;
  1182. CREATE VIEW `d46`.`discography` AS SELECT * FROM `a46`.`discography`;
  1183. CREATE VIEW `d46`.`genre` AS SELECT * FROM `a46`.`genre`;
  1184. CREATE VIEW `d46`.`karaokedata` AS SELECT * FROM `a46`.`karaokedata`;
  1185. CREATE VIEW `d46`.`path` AS SELECT * FROM `a46`.`path`;
  1186. CREATE VIEW `d46`.`song_artist` AS SELECT * FROM `a46`.`song_artist`;
  1187. CREATE VIEW `d46`.`song_genre` AS SELECT * FROM `a46`.`song_genre`;
  1188. CREATE VIEW `d46`.`version` AS SELECT * FROM `a46`.`version`;
  1189.  
  1190. CREATE VIEW `d46`.`song`
  1191. AS SELECT
  1192. `a46`.`globalsong`.`idSong` AS `idSong`,
  1193. `a46`.`globalsong`.`idAlbum` AS `idAlbum`,
  1194. `a46`.`globalsong`.`idPath` AS `idPath`,
  1195. `a46`.`globalsong`.`strArtists` AS `strArtists`,
  1196. `a46`.`globalsong`.`strGenres` AS `strGenres`,
  1197. `a46`.`globalsong`.`strTitle` AS `strTitle`,
  1198. `a46`.`globalsong`.`iTrack` AS `iTrack`,
  1199. `a46`.`globalsong`.`iDuration` AS `iDuration`,
  1200. `a46`.`globalsong`.`iYear` AS `iYear`,
  1201. `a46`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1202. `a46`.`globalsong`.`strFileName` AS `strFileName`,
  1203. `a46`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1204. `a46`.`globalsong`.`iTimesPlayed4` AS `iTimesPlayed`,
  1205. `a46`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1206. `a46`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1207. `a46`.`globalsong`.`idThumb` AS `idThumb`,
  1208. `a46`.`globalsong`.`lastplayed4` AS `lastplayed`,
  1209. `a46`.`globalsong`.`comment` AS `comment`,
  1210. `a46`.`globalsong`.`rating` AS `rating`
  1211. FROM `a46`.`globalsong`;
  1212.  
  1213. CREATE VIEW `d46`.`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 (`d46`.`album_artist` join `d46`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1223.  
  1224. CREATE VIEW `d46`.`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 (`d46`.`album` left join `d46`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1242.  
  1243. CREATE VIEW `d46`.`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 `d46`.`artist`;
  1261.  
  1262. CREATE VIEW `d46`.`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 (`d46`.`song_artist` join `d46`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1272.  
  1273. CREATE VIEW `d46`.`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 (((`d46`.`song` join `d46`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `d46`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `d46`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
  1300.  
  1301. CREATE DATABASE e46;
  1302. CREATE VIEW `e46`.`album` AS SELECT * FROM `a46`.`album`;
  1303. CREATE VIEW `e46`.`album_artist` AS SELECT * FROM `a46`.`album_artist`;
  1304. CREATE VIEW `e46`.`album_genre` AS SELECT * FROM `a46`.`album_genre`;
  1305. CREATE VIEW `e46`.`albuminfosong` AS SELECT * FROM `a46`.`albuminfosong`;
  1306. CREATE VIEW `e46`.`art` AS SELECT * FROM `a46`.`art`;
  1307. CREATE VIEW `e46`.`artist` AS SELECT * FROM `a46`.`artist`;
  1308. CREATE VIEW `e46`.`content` AS SELECT * FROM `a46`.`content`;
  1309. CREATE VIEW `e46`.`discography` AS SELECT * FROM `a46`.`discography`;
  1310. CREATE VIEW `e46`.`genre` AS SELECT * FROM `a46`.`genre`;
  1311. CREATE VIEW `e46`.`karaokedata` AS SELECT * FROM `a46`.`karaokedata`;
  1312. CREATE VIEW `e46`.`path` AS SELECT * FROM `a46`.`path`;
  1313. CREATE VIEW `e46`.`song_artist` AS SELECT * FROM `a46`.`song_artist`;
  1314. CREATE VIEW `e46`.`song_genre` AS SELECT * FROM `a46`.`song_genre`;
  1315. CREATE VIEW `e46`.`version` AS SELECT * FROM `a46`.`version`;
  1316.  
  1317. CREATE VIEW `e46`.`song`
  1318. AS SELECT
  1319. `a46`.`globalsong`.`idSong` AS `idSong`,
  1320. `a46`.`globalsong`.`idAlbum` AS `idAlbum`,
  1321. `a46`.`globalsong`.`idPath` AS `idPath`,
  1322. `a46`.`globalsong`.`strArtists` AS `strArtists`,
  1323. `a46`.`globalsong`.`strGenres` AS `strGenres`,
  1324. `a46`.`globalsong`.`strTitle` AS `strTitle`,
  1325. `a46`.`globalsong`.`iTrack` AS `iTrack`,
  1326. `a46`.`globalsong`.`iDuration` AS `iDuration`,
  1327. `a46`.`globalsong`.`iYear` AS `iYear`,
  1328. `a46`.`globalsong`.`dwFileNameCRC` AS `dwFileNameCRC`,
  1329. `a46`.`globalsong`.`strFileName` AS `strFileName`,
  1330. `a46`.`globalsong`.`strMusicBrainzTrackID` AS `strMusicBrainzTrackID`,
  1331. `a46`.`globalsong`.`iTimesPlayed5` AS `iTimesPlayed`,
  1332. `a46`.`globalsong`.`iStartOffset` AS `iStartOffset`,
  1333. `a46`.`globalsong`.`iEndOffset` AS `iEndOffset`,
  1334. `a46`.`globalsong`.`idThumb` AS `idThumb`,
  1335. `a46`.`globalsong`.`lastplayed5` AS `lastplayed`,
  1336. `a46`.`globalsong`.`comment` AS `comment`,
  1337. `a46`.`globalsong`.`rating` AS `rating`
  1338. FROM `a46`.`globalsong`;
  1339.  
  1340. CREATE VIEW `e46`.`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 (`e46`.`album_artist` join `e46`.`artist` on((`album_artist`.`idArtist` = `artist`.`idArtist`)));
  1350.  
  1351. CREATE VIEW `e46`.`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 (`e46`.`album` left join `e46`.`song` on((`album`.`idAlbum` = `song`.`idAlbum`))) group by `album`.`idAlbum`;
  1369.  
  1370. CREATE VIEW `e46`.`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 `e46`.`artist`;
  1388.  
  1389. CREATE VIEW `e46`.`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 (`e46`.`song_artist` join `e46`.`artist` on((`song_artist`.`idArtist` = `artist`.`idArtist`)));
  1399.  
  1400. CREATE VIEW `e46`.`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 (((`e46`.`song` join `e46`.`album` on((`song`.`idAlbum` = `album`.`idAlbum`))) join `e46`.`path` on((`song`.`idPath` = `path`.`idPath`))) left join `e46`.`karaokedata` on((`song`.`idSong` = `karaokedata`.`idSong`)));
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×