• 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 26
[MYSQL] HOW-TO: 5 User XBMC
(2015-07-30, 11:43)Bohemi Wrote: After some further tests I think the back ups are fine but I see that Isengard has different databases, therefor I assume this means that the code from link http://pastebin.com/0VNB9DmV is not working for this upgrade.

Just to be sure I don't make one big mess of it, I'll wait for confirmation on the correct approach.

Yeah, using that code won't work, because of the database name change. It would be easy to do a find and replace for "a90" to "a93" (I think) which corresponds to Isengard database version, and the same for b, c, d, and so for.
That for video, and for music from 48 to 52.

However, that will only work if there are no other significant changes in the database as far as the links that are made with the code.

At least that's how I understand it.
Reply
I will have a look at this soon, I haven't done the upgrade yet as I have 3x RPi2, Kodibuntu, Windows installs to deal with and i'm lacking in time atm.

Based on this link http://kodi.wiki/view/Database_versions
The DB has changed from Kodi 14 to Kodi 15
The video DB should stay at v93 - VideoDB

If someone don't beat me to it I will up a full Kodi 15 guild in the coming week or so as time permits.
Reply
I have done a little look into this over the last few hours and here is what I have.

@masterxilef That would be good but but there is some bigger changes in the Video DB tables in v90 was 45 now in v93 it's 34 and lots of changes with table names Sad

Please Note: I have only done very limited testing
Please let me know if something isn't working right,
as my testing was like 5 mins.

I had some slows but that was my SQL not my collection of 31,547 episodes (561 shows) collected 2,019 movies collected

- Start Kodi 15 on your master system, once loaded exit/shutdown that system, this is so the data is updated or the default tables are created.
- Now in your SQL editor like PHPMyAdmin you must run some SQL.

- My DB Names;
Kodi_Matt_Video_ <- Master User
Kodi_Mace_Video_
Kodi_Kiyana_Video_
Kodi_Jaide_Video_

I name mine like this so its easier to find the correct DB when doing other backend scripts and I have a bit going on with my SQL server.
Names will be based on the above but a simple find and replace can change the names to what you like.
[Find: Kodi_Matt_Video_ Replace With: a] from memory that's what this guide was using.

USER 01 is Master User
If you need more then 3 slaves, Copy the code from USER 02 or higher, then add them to the `globalfiles` table, this should be easy to understand

Known Bugs;
- When removing file from the DB it won't be cleaned from Slave Users bookmarks.
- Will error if View or Table exists (Work around, drop the table or view not on the master tho Smile or just skip that SQL cmd)

**** This SQL is for Video93 DB ONLY ****

GlobalFiles and Triggers
Code:
/* *****************
*** GlobalFiles ****
*******************/
  /* ONLY ON FRESH INSTALL */
    RENAME TABLE `Kodi_Matt_Video_93`.`files` to `Kodi_Matt_Video_93`.`globalfiles`;

  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` CHANGE playCount playCountMatt INT;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` CHANGE lastPlayed lastPlayedMatt TEXT;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD playCountMace INT(11) AFTER lastPlayedMatt;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD lastPlayedMace TEXT AFTER playCountMace;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD playCountKiyana INT(11) AFTER lastPlayedMace;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD lastPlayedKiyana TEXT AFTER playCountKiyana;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD playCountJaide INT(11) AFTER lastPlayedKiyana;
  ALTER TABLE `Kodi_Matt_Video_93`.`globalfiles` ADD lastPlayedJaide TEXT AFTER playCountJaide;
  /* As you can see above its easy to add or remove users from the globalfiles. Just remember there is two lines for each user. */

  /* If doing an upgrade it can freeze if have been using SQL this will update the DB Version number to stop the auto upgrade. */
  UPDATE `Kodi_Matt_Video_93`.`version` SET `idVersion` = '93' WHERE `idVersion` = '90'

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_person`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_person` AFTER DELETE ON `actor`
    FOR EACH ROW BEGIN
      DELETE FROM art WHERE media_id=old.actor_id AND media_type IN ('actor','artist','writer','director');
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_episode`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_episode`
    AFTER DELETE ON `episode`
    FOR EACH ROW BEGIN
      DELETE FROM actor_link WHERE media_id=old.idEpisode AND media_type='episode';
      DELETE FROM director_link WHERE media_id=old.idEpisode AND media_type='episode';
      DELETE FROM writer_link WHERE media_id=old.idEpisode AND media_type='episode';
      DELETE FROM art WHERE media_id=old.idEpisode AND media_type='episode';
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_file`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_file`
    AFTER DELETE ON `globalfiles`
    FOR EACH ROW BEGIN
      DELETE FROM bookmark WHERE idFile=old.idFile;
      DELETE FROM settings WHERE idFile=old.idFile;
      DELETE FROM stacktimes WHERE idFile=old.idFile;
      DELETE FROM streamdetails WHERE idFile=old.idFile;
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_movie`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_movie`
    AFTER DELETE ON `movie`
    FOR EACH ROW BEGIN
      DELETE FROM genre_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM actor_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM director_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM studio_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM country_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM writer_link WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM movielinktvshow WHERE idMovie=old.idMovie;
      DELETE FROM art WHERE media_id=old.idMovie AND media_type='movie';
      DELETE FROM tag_link WHERE media_id=old.idMovie AND media_type='movie';
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_musicvideo`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_musicvideo`
    AFTER DELETE ON `musicvideo`
    FOR EACH ROW BEGIN
      DELETE FROM actor_link WHERE media_id=old.idMVideo AND media_type='musicvideo';
      DELETE FROM director_link WHERE media_id=old.idMVideo AND media_type='musicvideo';
      DELETE FROM genre_link WHERE media_id=old.idMVideo AND media_type='musicvideo';
      DELETE FROM studio_link WHERE media_id=old.idMVideo AND media_type='musicvideo';
      DELETE FROM art WHERE media_id=old.idMVideo AND media_type='musicvideo';
      DELETE FROM tag_link WHERE media_id=old.idMVideo AND media_type='musicvideo';
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_season`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_season`
    AFTER DELETE ON `seasons`
    FOR EACH ROW BEGIN
      DELETE FROM art WHERE media_id=old.idSeason AND media_type='season';
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_set`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_set`
    AFTER DELETE ON `sets`
    FOR EACH ROW BEGIN
      DELETE FROM art WHERE media_id=old.idSet AND media_type='set';
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_tag`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_tag`
    AFTER DELETE ON `tag_link`
    FOR EACH ROW BEGIN
      DELETE FROM tag WHERE tag_id=old.tag_id AND tag_id NOT IN (SELECT DISTINCT tag_id FROM tag_link);
    END
  //
  DELIMITER ;

  DROP TRIGGER IF EXISTS `Kodi_Matt_Video_93`.`delete_tvshow`;
  DELIMITER //
  CREATE TRIGGER `Kodi_Matt_Video_93`.`delete_tvshow`
    AFTER DELETE ON `tvshow`
    FOR EACH ROW BEGIN
      DELETE FROM actor_link WHERE media_id=old.idShow AND media_type='tvshow';
      DELETE FROM director_link WHERE media_id=old.idShow AND media_type='tvshow';
      DELETE FROM studio_link WHERE media_id=old.idShow AND media_type='tvshow';
      DELETE FROM tvshowlinkpath WHERE idShow=old.idShow;
      DELETE FROM genre_link WHERE media_id=old.idShow AND media_type='tvshow';
      DELETE FROM movielinktvshow WHERE idShow=old.idShow;
      DELETE FROM seasons WHERE idShow=old.idShow;
      DELETE FROM art WHERE media_id=old.idShow AND media_type='tvshow';
      DELETE FROM tag_link WHERE media_id=old.idShow AND media_type='tvshow';
    END
  //
  DELIMITER ;

USER 01 - Master User
Code:
/* ************
*** USER 01 ***
**************/
  CREATE VIEW `Kodi_Matt_Video_93`.`files`
    AS SELECT
      `globalfiles`.`idFile` AS `idFile`,
      `globalfiles`.`idPath` AS `idPath`,
      `globalfiles`.`strFilename` AS `strFilename`,
      `globalfiles`.`playCountMatt` AS `playCount`,
      `globalfiles`.`lastPlayedMatt` AS `lastPlayed`,
      `globalfiles`.`dateAdded` AS `dateAdded`
    FROM `Kodi_Matt_Video_93`.`globalfiles`;

  CREATE VIEW `Kodi_Matt_Video_93`.`episode_view`
    AS SELECT
      `episode`.`idEpisode` AS `idEpisode`,
      `episode`.`idFile` AS `idFile`,
      `episode`.`c00` AS `c00`,
      `episode`.`c01` AS `c01`,
      `episode`.`c02` AS `c02`,
      `episode`.`c03` AS `c03`,
      `episode`.`c04` AS `c04`,
      `episode`.`c05` AS `c05`,
      `episode`.`c06` AS `c06`,
      `episode`.`c07` AS `c07`,
      `episode`.`c08` AS `c08`,
      `episode`.`c09` AS `c09`,
      `episode`.`c10` AS `c10`,
      `episode`.`c11` AS `c11`,
      `episode`.`c12` AS `c12`,
      `episode`.`c13` AS `c13`,
      `episode`.`c14` AS `c14`,
      `episode`.`c15` AS `c15`,
      `episode`.`c16` AS `c16`,
      `episode`.`c17` AS `c17`,
      `episode`.`c18` AS `c18`,
      `episode`.`c19` AS `c19`,
      `episode`.`c20` AS `c20`,
      `episode`.`c21` AS `c21`,
      `episode`.`c22` AS `c22`,
      `episode`.`c23` AS `c23`,
      `episode`.`idShow` AS `idShow`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `tvshow`.`c00` AS `strTitle`,
      `tvshow`.`c14` AS `studio`,
      `tvshow`.`c05` AS `premiered`,
      `tvshow`.`c13` AS `mpaa`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
      `seasons`.`idSeason` AS `idSeason`
    FROM (((((`Kodi_Matt_Video_93`.`episode` join `Kodi_Matt_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `Kodi_Matt_Video_93`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `Kodi_Matt_Video_93`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `Kodi_Matt_Video_93`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `Kodi_Matt_Video_93`.`bookmark` on(((`Kodi_Matt_Video_93`.`bookmark`.`idFile` = `episode`.`idFile`) and (`Kodi_Matt_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Matt_Video_93`.`movie_view`
    AS SELECT
      `movie`.`idMovie` AS `idMovie`,
      `movie`.`idFile` AS `idFile`,
      `movie`.`c00` AS `c00`,
      `movie`.`c01` AS `c01`,
      `movie`.`c02` AS `c02`,
      `movie`.`c03` AS `c03`,
      `movie`.`c04` AS `c04`,
      `movie`.`c05` AS `c05`,
      `movie`.`c06` AS `c06`,
      `movie`.`c07` AS `c07`,
      `movie`.`c08` AS `c08`,
      `movie`.`c09` AS `c09`,
      `movie`.`c10` AS `c10`,
      `movie`.`c11` AS `c11`,
      `movie`.`c12` AS `c12`,
      `movie`.`c13` AS `c13`,
      `movie`.`c14` AS `c14`,
      `movie`.`c15` AS `c15`,
      `movie`.`c16` AS `c16`,
      `movie`.`c17` AS `c17`,
      `movie`.`c18` AS `c18`,
      `movie`.`c19` AS `c19`,
      `movie`.`c20` AS `c20`,
      `movie`.`c21` AS `c21`,
      `movie`.`c22` AS `c22`,
      `movie`.`c23` AS `c23`,
      `movie`.`idSet` AS `idSet`,
      `sets`.`strSet` AS `strSet`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM ((((`Kodi_Matt_Video_93`.`movie` left join `Kodi_Matt_Video_93`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `Kodi_Matt_Video_93`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `Kodi_Matt_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Matt_Video_93`.`bookmark` on(((`Kodi_Matt_Video_93`.`bookmark`.`idFile` = `movie`.`idFile`) and (`Kodi_Matt_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Matt_Video_93`.`musicvideo_view`
    AS SELECT
      `musicvideo`.`idMVideo` AS `idMVideo`,
      `musicvideo`.`idFile` AS `idFile`,
      `musicvideo`.`c00` AS `c00`,
      `musicvideo`.`c01` AS `c01`,
      `musicvideo`.`c02` AS `c02`,
      `musicvideo`.`c03` AS `c03`,
      `musicvideo`.`c04` AS `c04`,
      `musicvideo`.`c05` AS `c05`,
      `musicvideo`.`c06` AS `c06`,
      `musicvideo`.`c07` AS `c07`,
      `musicvideo`.`c08` AS `c08`,
      `musicvideo`.`c09` AS `c09`,
      `musicvideo`.`c10` AS `c10`,
      `musicvideo`.`c11` AS `c11`,
      `musicvideo`.`c12` AS `c12`,
      `musicvideo`.`c13` AS `c13`,
      `musicvideo`.`c14` AS `c14`,
      `musicvideo`.`c15` AS `c15`,
      `musicvideo`.`c16` AS `c16`,
      `musicvideo`.`c17` AS `c17`,
      `musicvideo`.`c18` AS `c18`,
      `musicvideo`.`c19` AS `c19`,
      `musicvideo`.`c20` AS `c20`,
      `musicvideo`.`c21` AS `c21`,
      `musicvideo`.`c22` AS `c22`,
      `musicvideo`.`c23` AS `c23`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM (((`Kodi_Matt_Video_93`.`musicvideo` join `Kodi_Matt_Video_93`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `Kodi_Matt_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Matt_Video_93`.`bookmark` on(((`Kodi_Matt_Video_93`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`Kodi_Matt_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Matt_Video_93`.`tvshowcounts`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      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`,
      max(`files`.`dateAdded`) AS `dateAdded`
    FROM ((`Kodi_Matt_Video_93`.`tvshow` left join `Kodi_Matt_Video_93`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Matt_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Matt_Video_93`.`tvshow_view`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      `tvshow`.`c00` AS `c00`,
      `tvshow`.`c01` AS `c01`,
      `tvshow`.`c02` AS `c02`,
      `tvshow`.`c03` AS `c03`,
      `tvshow`.`c04` AS `c04`,
      `tvshow`.`c05` AS `c05`,
      `tvshow`.`c06` AS `c06`,
      `tvshow`.`c07` AS `c07`,
      `tvshow`.`c08` AS `c08`,
      `tvshow`.`c09` AS `c09`,
      `tvshow`.`c10` AS `c10`,
      `tvshow`.`c11` AS `c11`,
      `tvshow`.`c12` AS `c12`,
      `tvshow`.`c13` AS `c13`,
      `tvshow`.`c14` AS `c14`,
      `tvshow`.`c15` AS `c15`,
      `tvshow`.`c16` AS `c16`,
      `tvshow`.`c17` AS `c17`,
      `tvshow`.`c18` AS `c18`,
      `tvshow`.`c19` AS `c19`,
      `tvshow`.`c20` AS `c20`,
      `tvshow`.`c21` AS `c21`,
      `tvshow`.`c22` AS `c22`,
      `tvshow`.`c23` AS `c23`,
      `path`.`idParentPath` AS `idParentPath`,
      `path`.`strPath` AS `strPath`,
      `tvshowcounts`.`dateAdded` AS `dateAdded`,
      `tvshowcounts`.`lastPlayed` AS `lastPlayed`,
      `tvshowcounts`.`totalCount` AS `totalCount`,
      `tvshowcounts`.`watchedcount` AS `watchedcount`,
      `tvshowcounts`.`totalSeasons` AS `totalSeasons`
    FROM (((`Kodi_Matt_Video_93`.`tvshow` left join `Kodi_Matt_Video_93`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Matt_Video_93`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) join `Kodi_Matt_Video_93`.`tvshowcounts` on((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Matt_Video_93`.`season_view`
    AS SELECT
      `seasons`.`idSeason` AS `idSeason`,
      `seasons`.`idShow` AS `idShow`,
      `seasons`.`season` AS `season`,
      `tvshow_view`.`strPath` AS `strPath`,
      `tvshow_view`.`c00` AS `showTitle`,
      `tvshow_view`.`c01` AS `plot`,
      `tvshow_view`.`c05` AS `premiered`,
      `tvshow_view`.`c08` AS `genre`,
      `tvshow_view`.`c14` AS `studio`,
      `tvshow_view`.`c13` AS `mpaa`,
      count(distinct `episode_view`.`idEpisode`) AS `episodes`,
      count(`files`.`playCount`) AS `playCount`
    FROM (((`Kodi_Matt_Video_93`.`seasons` join `Kodi_Matt_Video_93`.`tvshow_view` on((`tvshow_view`.`idShow` = `seasons`.`idShow`))) join `Kodi_Matt_Video_93`.`episode_view` on(((`episode_view`.`idShow` = `seasons`.`idShow`) and (`episode_view`.`c12` = `seasons`.`season`)))) join `Kodi_Matt_Video_93`.`files` on((`files`.`idFile` = `episode_view`.`idFile`))) group by `seasons`.`idSeason`;

USER 02
Code:
/* ************
*** USER 02 ***
**************/
  CREATE DATABASE Kodi_Mace_Video_93;

  CREATE VIEW `Kodi_Mace_Video_93`.`actor` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor`;
  CREATE VIEW `Kodi_Mace_Video_93`.`actor_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`art` AS SELECT * FROM `Kodi_Matt_Video_93`.`art`;
  CREATE VIEW `Kodi_Mace_Video_93`.`country` AS SELECT * FROM `Kodi_Matt_Video_93`.`country`;
  CREATE VIEW `Kodi_Mace_Video_93`.`country_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`country_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`director_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`director_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`episode` AS SELECT * FROM `Kodi_Matt_Video_93`.`episode`;
  CREATE VIEW `Kodi_Mace_Video_93`.`genre` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre`;
  CREATE VIEW `Kodi_Mace_Video_93`.`genre_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`movie` AS SELECT * FROM `Kodi_Matt_Video_93`.`movie`;
  CREATE VIEW `Kodi_Mace_Video_93`.`movielinktvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`movielinktvshow`;
  CREATE VIEW `Kodi_Mace_Video_93`.`musicvideo` AS SELECT * FROM `Kodi_Matt_Video_93`.`musicvideo`;
  CREATE VIEW `Kodi_Mace_Video_93`.`path` AS SELECT * FROM `Kodi_Matt_Video_93`.`path`;
  CREATE VIEW `Kodi_Mace_Video_93`.`seasons` AS SELECT * FROM `Kodi_Matt_Video_93`.`seasons`;
  CREATE VIEW `Kodi_Mace_Video_93`.`sets` AS SELECT * FROM `Kodi_Matt_Video_93`.`sets`;
  CREATE VIEW `Kodi_Mace_Video_93`.`settings` AS SELECT * FROM `Kodi_Matt_Video_93`.`settings`;
  CREATE VIEW `Kodi_Mace_Video_93`.`stacktimes` AS SELECT * FROM `Kodi_Matt_Video_93`.`stacktimes`;
  CREATE VIEW `Kodi_Mace_Video_93`.`streamdetails` AS SELECT * FROM `Kodi_Matt_Video_93`.`streamdetails`;
  CREATE VIEW `Kodi_Mace_Video_93`.`studio` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio`;
  CREATE VIEW `Kodi_Mace_Video_93`.`studio_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`tag` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag`;
  CREATE VIEW `Kodi_Mace_Video_93`.`tag_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag_link`;
  CREATE VIEW `Kodi_Mace_Video_93`.`tvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshow`;
  CREATE VIEW `Kodi_Mace_Video_93`.`tvshowlinkpath` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshowlinkpath`;
  CREATE VIEW `Kodi_Mace_Video_93`.`version` AS SELECT * FROM `Kodi_Matt_Video_93`.`version`;
  CREATE VIEW `Kodi_Mace_Video_93`.`writer_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`writer_link`;

  CREATE VIEW `Kodi_Mace_Video_93`.`files`
    AS SELECT
      `globalfiles`.`idFile` AS `idFile`,
      `globalfiles`.`idPath` AS `idPath`,
      `globalfiles`.`strFilename` AS `strFilename`,
      `globalfiles`.`playCountJaide` AS `playCount`,
      `globalfiles`.`lastPlayedJaide` AS `lastPlayed`,
      `globalfiles`.`dateAdded` AS `dateAdded`
    FROM `Kodi_Matt_Video_93`.`globalfiles`;

  CREATE TABLE `Kodi_Mace_Video_93`.`bookmark` (
    `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
    `idFile` int(11) DEFAULT NULL,
    `timeInSeconds` double DEFAULT NULL,
    `totalTimeInSeconds` double DEFAULT NULL,
    `thumbNailImage` text,
    `player` text,
    `playerState` text,
    `type` int(11) DEFAULT NULL,
    PRIMARY KEY (`idBookmark`),
    KEY `ix_bookmark` (`idFile`,`type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  CREATE VIEW `Kodi_Mace_Video_93`.`episode_view`
    AS SELECT
      `episode`.`idEpisode` AS `idEpisode`,
      `episode`.`idFile` AS `idFile`,
      `episode`.`c00` AS `c00`,
      `episode`.`c01` AS `c01`,
      `episode`.`c02` AS `c02`,
      `episode`.`c03` AS `c03`,
      `episode`.`c04` AS `c04`,
      `episode`.`c05` AS `c05`,
      `episode`.`c06` AS `c06`,
      `episode`.`c07` AS `c07`,
      `episode`.`c08` AS `c08`,
      `episode`.`c09` AS `c09`,
      `episode`.`c10` AS `c10`,
      `episode`.`c11` AS `c11`,
      `episode`.`c12` AS `c12`,
      `episode`.`c13` AS `c13`,
      `episode`.`c14` AS `c14`,
      `episode`.`c15` AS `c15`,
      `episode`.`c16` AS `c16`,
      `episode`.`c17` AS `c17`,
      `episode`.`c18` AS `c18`,
      `episode`.`c19` AS `c19`,
      `episode`.`c20` AS `c20`,
      `episode`.`c21` AS `c21`,
      `episode`.`c22` AS `c22`,
      `episode`.`c23` AS `c23`,
      `episode`.`idShow` AS `idShow`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `tvshow`.`c00` AS `strTitle`,
      `tvshow`.`c14` AS `studio`,
      `tvshow`.`c05` AS `premiered`,
      `tvshow`.`c13` AS `mpaa`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
      `seasons`.`idSeason` AS `idSeason`
    FROM (((((`Kodi_Mace_Video_93`.`episode` join `Kodi_Mace_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `Kodi_Mace_Video_93`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `Kodi_Mace_Video_93`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `Kodi_Mace_Video_93`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `Kodi_Mace_Video_93`.`bookmark` on(((`Kodi_Mace_Video_93`.`bookmark`.`idFile` = `episode`.`idFile`) and (`Kodi_Mace_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Mace_Video_93`.`movie_view`
    AS SELECT
      `movie`.`idMovie` AS `idMovie`,
      `movie`.`idFile` AS `idFile`,
      `movie`.`c00` AS `c00`,
      `movie`.`c01` AS `c01`,
      `movie`.`c02` AS `c02`,
      `movie`.`c03` AS `c03`,
      `movie`.`c04` AS `c04`,
      `movie`.`c05` AS `c05`,
      `movie`.`c06` AS `c06`,
      `movie`.`c07` AS `c07`,
      `movie`.`c08` AS `c08`,
      `movie`.`c09` AS `c09`,
      `movie`.`c10` AS `c10`,
      `movie`.`c11` AS `c11`,
      `movie`.`c12` AS `c12`,
      `movie`.`c13` AS `c13`,
      `movie`.`c14` AS `c14`,
      `movie`.`c15` AS `c15`,
      `movie`.`c16` AS `c16`,
      `movie`.`c17` AS `c17`,
      `movie`.`c18` AS `c18`,
      `movie`.`c19` AS `c19`,
      `movie`.`c20` AS `c20`,
      `movie`.`c21` AS `c21`,
      `movie`.`c22` AS `c22`,
      `movie`.`c23` AS `c23`,
      `movie`.`idSet` AS `idSet`,
      `sets`.`strSet` AS `strSet`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM ((((`Kodi_Mace_Video_93`.`movie` left join `Kodi_Mace_Video_93`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `Kodi_Mace_Video_93`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `Kodi_Mace_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Mace_Video_93`.`bookmark` on(((`Kodi_Mace_Video_93`.`bookmark`.`idFile` = `movie`.`idFile`) and (`Kodi_Mace_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Mace_Video_93`.`musicvideo_view`
    AS SELECT
      `musicvideo`.`idMVideo` AS `idMVideo`,
      `musicvideo`.`idFile` AS `idFile`,
      `musicvideo`.`c00` AS `c00`,
      `musicvideo`.`c01` AS `c01`,
      `musicvideo`.`c02` AS `c02`,
      `musicvideo`.`c03` AS `c03`,
      `musicvideo`.`c04` AS `c04`,
      `musicvideo`.`c05` AS `c05`,
      `musicvideo`.`c06` AS `c06`,
      `musicvideo`.`c07` AS `c07`,
      `musicvideo`.`c08` AS `c08`,
      `musicvideo`.`c09` AS `c09`,
      `musicvideo`.`c10` AS `c10`,
      `musicvideo`.`c11` AS `c11`,
      `musicvideo`.`c12` AS `c12`,
      `musicvideo`.`c13` AS `c13`,
      `musicvideo`.`c14` AS `c14`,
      `musicvideo`.`c15` AS `c15`,
      `musicvideo`.`c16` AS `c16`,
      `musicvideo`.`c17` AS `c17`,
      `musicvideo`.`c18` AS `c18`,
      `musicvideo`.`c19` AS `c19`,
      `musicvideo`.`c20` AS `c20`,
      `musicvideo`.`c21` AS `c21`,
      `musicvideo`.`c22` AS `c22`,
      `musicvideo`.`c23` AS `c23`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM (((`Kodi_Mace_Video_93`.`musicvideo` join `Kodi_Mace_Video_93`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `Kodi_Mace_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Mace_Video_93`.`bookmark` on(((`Kodi_Mace_Video_93`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`Kodi_Mace_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Mace_Video_93`.`tvshowcounts`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      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`,
      max(`files`.`dateAdded`) AS `dateAdded`
    FROM ((`Kodi_Mace_Video_93`.`tvshow` left join `Kodi_Mace_Video_93`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Mace_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Mace_Video_93`.`tvshow_view`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      `tvshow`.`c00` AS `c00`,
      `tvshow`.`c01` AS `c01`,
      `tvshow`.`c02` AS `c02`,
      `tvshow`.`c03` AS `c03`,
      `tvshow`.`c04` AS `c04`,
      `tvshow`.`c05` AS `c05`,
      `tvshow`.`c06` AS `c06`,
      `tvshow`.`c07` AS `c07`,
      `tvshow`.`c08` AS `c08`,
      `tvshow`.`c09` AS `c09`,
      `tvshow`.`c10` AS `c10`,
      `tvshow`.`c11` AS `c11`,
      `tvshow`.`c12` AS `c12`,
      `tvshow`.`c13` AS `c13`,
      `tvshow`.`c14` AS `c14`,
      `tvshow`.`c15` AS `c15`,
      `tvshow`.`c16` AS `c16`,
      `tvshow`.`c17` AS `c17`,
      `tvshow`.`c18` AS `c18`,
      `tvshow`.`c19` AS `c19`,
      `tvshow`.`c20` AS `c20`,
      `tvshow`.`c21` AS `c21`,
      `tvshow`.`c22` AS `c22`,
      `tvshow`.`c23` AS `c23`,
      `path`.`idParentPath` AS `idParentPath`,
      `path`.`strPath` AS `strPath`,
      `tvshowcounts`.`dateAdded` AS `dateAdded`,
      `tvshowcounts`.`lastPlayed` AS `lastPlayed`,
      `tvshowcounts`.`totalCount` AS `totalCount`,
      `tvshowcounts`.`watchedcount` AS `watchedcount`,
      `tvshowcounts`.`totalSeasons` AS `totalSeasons`
    FROM (((`Kodi_Mace_Video_93`.`tvshow` left join `Kodi_Mace_Video_93`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Mace_Video_93`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) join `Kodi_Mace_Video_93`.`tvshowcounts` on((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Mace_Video_93`.`season_view`
    AS SELECT
      `seasons`.`idSeason` AS `idSeason`,
      `seasons`.`idShow` AS `idShow`,
      `seasons`.`season` AS `season`,
      `tvshow_view`.`strPath` AS `strPath`,
      `tvshow_view`.`c00` AS `showTitle`,
      `tvshow_view`.`c01` AS `plot`,
      `tvshow_view`.`c05` AS `premiered`,
      `tvshow_view`.`c08` AS `genre`,
      `tvshow_view`.`c14` AS `studio`,
      `tvshow_view`.`c13` AS `mpaa`,
      count(distinct `episode_view`.`idEpisode`) AS `episodes`,
      count(`files`.`playCount`) AS `playCount`
    FROM (((`Kodi_Mace_Video_93`.`seasons` join `Kodi_Mace_Video_93`.`tvshow_view` on((`tvshow_view`.`idShow` = `seasons`.`idShow`))) join `Kodi_Mace_Video_93`.`episode_view` on(((`episode_view`.`idShow` = `seasons`.`idShow`) and (`episode_view`.`c12` = `seasons`.`season`)))) join `Kodi_Mace_Video_93`.`files` on((`files`.`idFile` = `episode_view`.`idFile`))) group by `seasons`.`idSeason`;

USER 03
Code:
/* ************
*** USER 03 ***
**************/
  CREATE DATABASE Kodi_Kiyana_Video_93;

  CREATE VIEW `Kodi_Kiyana_Video_93`.`actor` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`actor_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`art` AS SELECT * FROM `Kodi_Matt_Video_93`.`art`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`country` AS SELECT * FROM `Kodi_Matt_Video_93`.`country`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`country_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`country_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`director_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`director_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`episode` AS SELECT * FROM `Kodi_Matt_Video_93`.`episode`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`genre` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`genre_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`movie` AS SELECT * FROM `Kodi_Matt_Video_93`.`movie`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`movielinktvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`movielinktvshow`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`musicvideo` AS SELECT * FROM `Kodi_Matt_Video_93`.`musicvideo`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`path` AS SELECT * FROM `Kodi_Matt_Video_93`.`path`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`seasons` AS SELECT * FROM `Kodi_Matt_Video_93`.`seasons`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`sets` AS SELECT * FROM `Kodi_Matt_Video_93`.`sets`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`settings` AS SELECT * FROM `Kodi_Matt_Video_93`.`settings`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`stacktimes` AS SELECT * FROM `Kodi_Matt_Video_93`.`stacktimes`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`streamdetails` AS SELECT * FROM `Kodi_Matt_Video_93`.`streamdetails`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`studio` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`studio_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`tag` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`tag_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag_link`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`tvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshow`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`tvshowlinkpath` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshowlinkpath`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`version` AS SELECT * FROM `Kodi_Matt_Video_93`.`version`;
  CREATE VIEW `Kodi_Kiyana_Video_93`.`writer_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`writer_link`;

  CREATE VIEW `Kodi_Kiyana_Video_93`.`files`
    AS SELECT
      `globalfiles`.`idFile` AS `idFile`,
      `globalfiles`.`idPath` AS `idPath`,
      `globalfiles`.`strFilename` AS `strFilename`,
      `globalfiles`.`playCountJaide` AS `playCount`,
      `globalfiles`.`lastPlayedJaide` AS `lastPlayed`,
      `globalfiles`.`dateAdded` AS `dateAdded`
    FROM `Kodi_Matt_Video_93`.`globalfiles`;

  CREATE TABLE `Kodi_Kiyana_Video_93`.`bookmark` (
    `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
    `idFile` int(11) DEFAULT NULL,
    `timeInSeconds` double DEFAULT NULL,
    `totalTimeInSeconds` double DEFAULT NULL,
    `thumbNailImage` text,
    `player` text,
    `playerState` text,
    `type` int(11) DEFAULT NULL,
    PRIMARY KEY (`idBookmark`),
    KEY `ix_bookmark` (`idFile`,`type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  CREATE VIEW `Kodi_Kiyana_Video_93`.`episode_view`
    AS SELECT
      `episode`.`idEpisode` AS `idEpisode`,
      `episode`.`idFile` AS `idFile`,
      `episode`.`c00` AS `c00`,
      `episode`.`c01` AS `c01`,
      `episode`.`c02` AS `c02`,
      `episode`.`c03` AS `c03`,
      `episode`.`c04` AS `c04`,
      `episode`.`c05` AS `c05`,
      `episode`.`c06` AS `c06`,
      `episode`.`c07` AS `c07`,
      `episode`.`c08` AS `c08`,
      `episode`.`c09` AS `c09`,
      `episode`.`c10` AS `c10`,
      `episode`.`c11` AS `c11`,
      `episode`.`c12` AS `c12`,
      `episode`.`c13` AS `c13`,
      `episode`.`c14` AS `c14`,
      `episode`.`c15` AS `c15`,
      `episode`.`c16` AS `c16`,
      `episode`.`c17` AS `c17`,
      `episode`.`c18` AS `c18`,
      `episode`.`c19` AS `c19`,
      `episode`.`c20` AS `c20`,
      `episode`.`c21` AS `c21`,
      `episode`.`c22` AS `c22`,
      `episode`.`c23` AS `c23`,
      `episode`.`idShow` AS `idShow`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `tvshow`.`c00` AS `strTitle`,
      `tvshow`.`c14` AS `studio`,
      `tvshow`.`c05` AS `premiered`,
      `tvshow`.`c13` AS `mpaa`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
      `seasons`.`idSeason` AS `idSeason`
    FROM (((((`Kodi_Kiyana_Video_93`.`episode` join `Kodi_Kiyana_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `Kodi_Kiyana_Video_93`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `Kodi_Kiyana_Video_93`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `Kodi_Kiyana_Video_93`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `Kodi_Kiyana_Video_93`.`bookmark` on(((`Kodi_Kiyana_Video_93`.`bookmark`.`idFile` = `episode`.`idFile`) and (`Kodi_Kiyana_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Kiyana_Video_93`.`movie_view`
    AS SELECT
      `movie`.`idMovie` AS `idMovie`,
      `movie`.`idFile` AS `idFile`,
      `movie`.`c00` AS `c00`,
      `movie`.`c01` AS `c01`,
      `movie`.`c02` AS `c02`,
      `movie`.`c03` AS `c03`,
      `movie`.`c04` AS `c04`,
      `movie`.`c05` AS `c05`,
      `movie`.`c06` AS `c06`,
      `movie`.`c07` AS `c07`,
      `movie`.`c08` AS `c08`,
      `movie`.`c09` AS `c09`,
      `movie`.`c10` AS `c10`,
      `movie`.`c11` AS `c11`,
      `movie`.`c12` AS `c12`,
      `movie`.`c13` AS `c13`,
      `movie`.`c14` AS `c14`,
      `movie`.`c15` AS `c15`,
      `movie`.`c16` AS `c16`,
      `movie`.`c17` AS `c17`,
      `movie`.`c18` AS `c18`,
      `movie`.`c19` AS `c19`,
      `movie`.`c20` AS `c20`,
      `movie`.`c21` AS `c21`,
      `movie`.`c22` AS `c22`,
      `movie`.`c23` AS `c23`,
      `movie`.`idSet` AS `idSet`,
      `sets`.`strSet` AS `strSet`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM ((((`Kodi_Kiyana_Video_93`.`movie` left join `Kodi_Kiyana_Video_93`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `Kodi_Kiyana_Video_93`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `Kodi_Kiyana_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Kiyana_Video_93`.`bookmark` on(((`Kodi_Kiyana_Video_93`.`bookmark`.`idFile` = `movie`.`idFile`) and (`Kodi_Kiyana_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Kiyana_Video_93`.`musicvideo_view`
    AS SELECT
      `musicvideo`.`idMVideo` AS `idMVideo`,
      `musicvideo`.`idFile` AS `idFile`,
      `musicvideo`.`c00` AS `c00`,
      `musicvideo`.`c01` AS `c01`,
      `musicvideo`.`c02` AS `c02`,
      `musicvideo`.`c03` AS `c03`,
      `musicvideo`.`c04` AS `c04`,
      `musicvideo`.`c05` AS `c05`,
      `musicvideo`.`c06` AS `c06`,
      `musicvideo`.`c07` AS `c07`,
      `musicvideo`.`c08` AS `c08`,
      `musicvideo`.`c09` AS `c09`,
      `musicvideo`.`c10` AS `c10`,
      `musicvideo`.`c11` AS `c11`,
      `musicvideo`.`c12` AS `c12`,
      `musicvideo`.`c13` AS `c13`,
      `musicvideo`.`c14` AS `c14`,
      `musicvideo`.`c15` AS `c15`,
      `musicvideo`.`c16` AS `c16`,
      `musicvideo`.`c17` AS `c17`,
      `musicvideo`.`c18` AS `c18`,
      `musicvideo`.`c19` AS `c19`,
      `musicvideo`.`c20` AS `c20`,
      `musicvideo`.`c21` AS `c21`,
      `musicvideo`.`c22` AS `c22`,
      `musicvideo`.`c23` AS `c23`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM (((`Kodi_Kiyana_Video_93`.`musicvideo` join `Kodi_Kiyana_Video_93`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `Kodi_Kiyana_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Kiyana_Video_93`.`bookmark` on(((`Kodi_Kiyana_Video_93`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`Kodi_Kiyana_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Kiyana_Video_93`.`tvshowcounts`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      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`,
      max(`files`.`dateAdded`) AS `dateAdded`
    FROM ((`Kodi_Kiyana_Video_93`.`tvshow` left join `Kodi_Kiyana_Video_93`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Kiyana_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Kiyana_Video_93`.`tvshow_view`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      `tvshow`.`c00` AS `c00`,
      `tvshow`.`c01` AS `c01`,
      `tvshow`.`c02` AS `c02`,
      `tvshow`.`c03` AS `c03`,
      `tvshow`.`c04` AS `c04`,
      `tvshow`.`c05` AS `c05`,
      `tvshow`.`c06` AS `c06`,
      `tvshow`.`c07` AS `c07`,
      `tvshow`.`c08` AS `c08`,
      `tvshow`.`c09` AS `c09`,
      `tvshow`.`c10` AS `c10`,
      `tvshow`.`c11` AS `c11`,
      `tvshow`.`c12` AS `c12`,
      `tvshow`.`c13` AS `c13`,
      `tvshow`.`c14` AS `c14`,
      `tvshow`.`c15` AS `c15`,
      `tvshow`.`c16` AS `c16`,
      `tvshow`.`c17` AS `c17`,
      `tvshow`.`c18` AS `c18`,
      `tvshow`.`c19` AS `c19`,
      `tvshow`.`c20` AS `c20`,
      `tvshow`.`c21` AS `c21`,
      `tvshow`.`c22` AS `c22`,
      `tvshow`.`c23` AS `c23`,
      `path`.`idParentPath` AS `idParentPath`,
      `path`.`strPath` AS `strPath`,
      `tvshowcounts`.`dateAdded` AS `dateAdded`,
      `tvshowcounts`.`lastPlayed` AS `lastPlayed`,
      `tvshowcounts`.`totalCount` AS `totalCount`,
      `tvshowcounts`.`watchedcount` AS `watchedcount`,
      `tvshowcounts`.`totalSeasons` AS `totalSeasons`
    FROM (((`Kodi_Kiyana_Video_93`.`tvshow` left join `Kodi_Kiyana_Video_93`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Kiyana_Video_93`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) join `Kodi_Kiyana_Video_93`.`tvshowcounts` on((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Kiyana_Video_93`.`season_view`
    AS SELECT
      `seasons`.`idSeason` AS `idSeason`,
      `seasons`.`idShow` AS `idShow`,
      `seasons`.`season` AS `season`,
      `tvshow_view`.`strPath` AS `strPath`,
      `tvshow_view`.`c00` AS `showTitle`,
      `tvshow_view`.`c01` AS `plot`,
      `tvshow_view`.`c05` AS `premiered`,
      `tvshow_view`.`c08` AS `genre`,
      `tvshow_view`.`c14` AS `studio`,
      `tvshow_view`.`c13` AS `mpaa`,
      count(distinct `episode_view`.`idEpisode`) AS `episodes`,
      count(`files`.`playCount`) AS `playCount`
    FROM (((`Kodi_Kiyana_Video_93`.`seasons` join `Kodi_Kiyana_Video_93`.`tvshow_view` on((`tvshow_view`.`idShow` = `seasons`.`idShow`))) join `Kodi_Kiyana_Video_93`.`episode_view` on(((`episode_view`.`idShow` = `seasons`.`idShow`) and (`episode_view`.`c12` = `seasons`.`season`)))) join `Kodi_Kiyana_Video_93`.`files` on((`files`.`idFile` = `episode_view`.`idFile`))) group by `seasons`.`idSeason`;

USER 04
Code:
/* ************
*** USER 04 ***
**************/
  CREATE DATABASE Kodi_Jaide_Video_93;

  CREATE VIEW `Kodi_Jaide_Video_93`.`actor` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`actor_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`actor_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`art` AS SELECT * FROM `Kodi_Matt_Video_93`.`art`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`country` AS SELECT * FROM `Kodi_Matt_Video_93`.`country`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`country_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`country_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`director_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`director_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`episode` AS SELECT * FROM `Kodi_Matt_Video_93`.`episode`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`genre` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`genre_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`genre_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`movie` AS SELECT * FROM `Kodi_Matt_Video_93`.`movie`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`movielinktvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`movielinktvshow`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`musicvideo` AS SELECT * FROM `Kodi_Matt_Video_93`.`musicvideo`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`path` AS SELECT * FROM `Kodi_Matt_Video_93`.`path`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`seasons` AS SELECT * FROM `Kodi_Matt_Video_93`.`seasons`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`sets` AS SELECT * FROM `Kodi_Matt_Video_93`.`sets`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`settings` AS SELECT * FROM `Kodi_Matt_Video_93`.`settings`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`stacktimes` AS SELECT * FROM `Kodi_Matt_Video_93`.`stacktimes`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`streamdetails` AS SELECT * FROM `Kodi_Matt_Video_93`.`streamdetails`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`studio` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`studio_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`studio_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`tag` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`tag_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`tag_link`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`tvshow` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshow`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`tvshowlinkpath` AS SELECT * FROM `Kodi_Matt_Video_93`.`tvshowlinkpath`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`version` AS SELECT * FROM `Kodi_Matt_Video_93`.`version`;
  CREATE VIEW `Kodi_Jaide_Video_93`.`writer_link` AS SELECT * FROM `Kodi_Matt_Video_93`.`writer_link`;

  CREATE VIEW `Kodi_Jaide_Video_93`.`files`
    AS SELECT
      `globalfiles`.`idFile` AS `idFile`,
      `globalfiles`.`idPath` AS `idPath`,
      `globalfiles`.`strFilename` AS `strFilename`,
      `globalfiles`.`playCountJaide` AS `playCount`,
      `globalfiles`.`lastPlayedJaide` AS `lastPlayed`,
      `globalfiles`.`dateAdded` AS `dateAdded`
    FROM `Kodi_Matt_Video_93`.`globalfiles`;

  CREATE TABLE `Kodi_Jaide_Video_93`.`bookmark` (
    `idBookmark` int(11) NOT NULL AUTO_INCREMENT,
    `idFile` int(11) DEFAULT NULL,
    `timeInSeconds` double DEFAULT NULL,
    `totalTimeInSeconds` double DEFAULT NULL,
    `thumbNailImage` text,
    `player` text,
    `playerState` text,
    `type` int(11) DEFAULT NULL,
    PRIMARY KEY (`idBookmark`),
    KEY `ix_bookmark` (`idFile`,`type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  CREATE VIEW `Kodi_Jaide_Video_93`.`episode_view`
    AS SELECT
      `episode`.`idEpisode` AS `idEpisode`,
      `episode`.`idFile` AS `idFile`,
      `episode`.`c00` AS `c00`,
      `episode`.`c01` AS `c01`,
      `episode`.`c02` AS `c02`,
      `episode`.`c03` AS `c03`,
      `episode`.`c04` AS `c04`,
      `episode`.`c05` AS `c05`,
      `episode`.`c06` AS `c06`,
      `episode`.`c07` AS `c07`,
      `episode`.`c08` AS `c08`,
      `episode`.`c09` AS `c09`,
      `episode`.`c10` AS `c10`,
      `episode`.`c11` AS `c11`,
      `episode`.`c12` AS `c12`,
      `episode`.`c13` AS `c13`,
      `episode`.`c14` AS `c14`,
      `episode`.`c15` AS `c15`,
      `episode`.`c16` AS `c16`,
      `episode`.`c17` AS `c17`,
      `episode`.`c18` AS `c18`,
      `episode`.`c19` AS `c19`,
      `episode`.`c20` AS `c20`,
      `episode`.`c21` AS `c21`,
      `episode`.`c22` AS `c22`,
      `episode`.`c23` AS `c23`,
      `episode`.`idShow` AS `idShow`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `tvshow`.`c00` AS `strTitle`,
      `tvshow`.`c14` AS `studio`,
      `tvshow`.`c05` AS `premiered`,
      `tvshow`.`c13` AS `mpaa`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,
      `seasons`.`idSeason` AS `idSeason`
    FROM (((((`Kodi_Jaide_Video_93`.`episode` join `Kodi_Jaide_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) join `Kodi_Jaide_Video_93`.`tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) left join `Kodi_Jaide_Video_93`.`seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) join `Kodi_Jaide_Video_93`.`path` on((`files`.`idPath` = `path`.`idPath`))) left join `Kodi_Jaide_Video_93`.`bookmark` on(((`Kodi_Jaide_Video_93`.`bookmark`.`idFile` = `episode`.`idFile`) and (`Kodi_Jaide_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Jaide_Video_93`.`movie_view`
    AS SELECT
      `movie`.`idMovie` AS `idMovie`,
      `movie`.`idFile` AS `idFile`,
      `movie`.`c00` AS `c00`,
      `movie`.`c01` AS `c01`,
      `movie`.`c02` AS `c02`,
      `movie`.`c03` AS `c03`,
      `movie`.`c04` AS `c04`,
      `movie`.`c05` AS `c05`,
      `movie`.`c06` AS `c06`,
      `movie`.`c07` AS `c07`,
      `movie`.`c08` AS `c08`,
      `movie`.`c09` AS `c09`,
      `movie`.`c10` AS `c10`,
      `movie`.`c11` AS `c11`,
      `movie`.`c12` AS `c12`,
      `movie`.`c13` AS `c13`,
      `movie`.`c14` AS `c14`,
      `movie`.`c15` AS `c15`,
      `movie`.`c16` AS `c16`,
      `movie`.`c17` AS `c17`,
      `movie`.`c18` AS `c18`,
      `movie`.`c19` AS `c19`,
      `movie`.`c20` AS `c20`,
      `movie`.`c21` AS `c21`,
      `movie`.`c22` AS `c22`,
      `movie`.`c23` AS `c23`,
      `movie`.`idSet` AS `idSet`,
      `sets`.`strSet` AS `strSet`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM ((((`Kodi_Jaide_Video_93`.`movie` left join `Kodi_Jaide_Video_93`.`sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `Kodi_Jaide_Video_93`.`files` on((`files`.`idFile` = `movie`.`idFile`))) join `Kodi_Jaide_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Jaide_Video_93`.`bookmark` on(((`Kodi_Jaide_Video_93`.`bookmark`.`idFile` = `movie`.`idFile`) and (`Kodi_Jaide_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Jaide_Video_93`.`musicvideo_view`
    AS SELECT
      `musicvideo`.`idMVideo` AS `idMVideo`,
      `musicvideo`.`idFile` AS `idFile`,
      `musicvideo`.`c00` AS `c00`,
      `musicvideo`.`c01` AS `c01`,
      `musicvideo`.`c02` AS `c02`,
      `musicvideo`.`c03` AS `c03`,
      `musicvideo`.`c04` AS `c04`,
      `musicvideo`.`c05` AS `c05`,
      `musicvideo`.`c06` AS `c06`,
      `musicvideo`.`c07` AS `c07`,
      `musicvideo`.`c08` AS `c08`,
      `musicvideo`.`c09` AS `c09`,
      `musicvideo`.`c10` AS `c10`,
      `musicvideo`.`c11` AS `c11`,
      `musicvideo`.`c12` AS `c12`,
      `musicvideo`.`c13` AS `c13`,
      `musicvideo`.`c14` AS `c14`,
      `musicvideo`.`c15` AS `c15`,
      `musicvideo`.`c16` AS `c16`,
      `musicvideo`.`c17` AS `c17`,
      `musicvideo`.`c18` AS `c18`,
      `musicvideo`.`c19` AS `c19`,
      `musicvideo`.`c20` AS `c20`,
      `musicvideo`.`c21` AS `c21`,
      `musicvideo`.`c22` AS `c22`,
      `musicvideo`.`c23` AS `c23`,
      `files`.`strFilename` AS `strFileName`,
      `path`.`strPath` AS `strPath`,
      `files`.`playCount` AS `playCount`,
      `files`.`lastPlayed` AS `lastPlayed`,
      `files`.`dateAdded` AS `dateAdded`,
      `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,
      `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`
    FROM (((`Kodi_Jaide_Video_93`.`musicvideo` join `Kodi_Jaide_Video_93`.`files` on((`files`.`idFile` = `musicvideo`.`idFile`))) join `Kodi_Jaide_Video_93`.`path` on((`path`.`idPath` = `files`.`idPath`))) left join `Kodi_Jaide_Video_93`.`bookmark` on(((`Kodi_Jaide_Video_93`.`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`Kodi_Jaide_Video_93`.`bookmark`.`type` = 1))));

  CREATE VIEW `Kodi_Jaide_Video_93`.`tvshowcounts`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      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`,
      max(`files`.`dateAdded`) AS `dateAdded`
    FROM ((`Kodi_Jaide_Video_93`.`tvshow` left join `Kodi_Jaide_Video_93`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Jaide_Video_93`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Jaide_Video_93`.`tvshow_view`
    AS SELECT
      `tvshow`.`idShow` AS `idShow`,
      `tvshow`.`c00` AS `c00`,
      `tvshow`.`c01` AS `c01`,
      `tvshow`.`c02` AS `c02`,
      `tvshow`.`c03` AS `c03`,
      `tvshow`.`c04` AS `c04`,
      `tvshow`.`c05` AS `c05`,
      `tvshow`.`c06` AS `c06`,
      `tvshow`.`c07` AS `c07`,
      `tvshow`.`c08` AS `c08`,
      `tvshow`.`c09` AS `c09`,
      `tvshow`.`c10` AS `c10`,
      `tvshow`.`c11` AS `c11`,
      `tvshow`.`c12` AS `c12`,
      `tvshow`.`c13` AS `c13`,
      `tvshow`.`c14` AS `c14`,
      `tvshow`.`c15` AS `c15`,
      `tvshow`.`c16` AS `c16`,
      `tvshow`.`c17` AS `c17`,
      `tvshow`.`c18` AS `c18`,
      `tvshow`.`c19` AS `c19`,
      `tvshow`.`c20` AS `c20`,
      `tvshow`.`c21` AS `c21`,
      `tvshow`.`c22` AS `c22`,
      `tvshow`.`c23` AS `c23`,
      `path`.`idParentPath` AS `idParentPath`,
      `path`.`strPath` AS `strPath`,
      `tvshowcounts`.`dateAdded` AS `dateAdded`,
      `tvshowcounts`.`lastPlayed` AS `lastPlayed`,
      `tvshowcounts`.`totalCount` AS `totalCount`,
      `tvshowcounts`.`watchedcount` AS `watchedcount`,
      `tvshowcounts`.`totalSeasons` AS `totalSeasons`
    FROM (((`Kodi_Jaide_Video_93`.`tvshow` left join `Kodi_Jaide_Video_93`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `Kodi_Jaide_Video_93`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) join `Kodi_Jaide_Video_93`.`tvshowcounts` on((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) group by `tvshow`.`idShow`;

  CREATE VIEW `Kodi_Jaide_Video_93`.`season_view`
    AS SELECT
      `seasons`.`idSeason` AS `idSeason`,
      `seasons`.`idShow` AS `idShow`,
      `seasons`.`season` AS `season`,
      `tvshow_view`.`strPath` AS `strPath`,
      `tvshow_view`.`c00` AS `showTitle`,
      `tvshow_view`.`c01` AS `plot`,
      `tvshow_view`.`c05` AS `premiered`,
      `tvshow_view`.`c08` AS `genre`,
      `tvshow_view`.`c14` AS `studio`,
      `tvshow_view`.`c13` AS `mpaa`,
      count(distinct `episode_view`.`idEpisode`) AS `episodes`,
      count(`files`.`playCount`) AS `playCount`
    FROM (((`Kodi_Jaide_Video_93`.`seasons` join `Kodi_Jaide_Video_93`.`tvshow_view` on((`tvshow_view`.`idShow` = `seasons`.`idShow`))) join `Kodi_Jaide_Video_93`.`episode_view` on(((`episode_view`.`idShow` = `seasons`.`idShow`) and (`episode_view`.`c12` = `seasons`.`season`)))) join `Kodi_Jaide_Video_93`.`files` on((`files`.`idFile` = `episode_view`.`idFile`))) group by `seasons`.`idSeason`;

Can't work out Signatures so I just add it here Smile
------------------------
Image
Reply
Is there a simpler solution for this? I would like to have 2 or 3 profiles sharingt he same database and keeping watch stats separate. This seems a bit much to get something so simple done.
Reply
(2015-08-13, 01:50)Deihmos Wrote: Is there a simpler solution for this? I would like to have 2 or 3 profiles sharingt he same database and keeping watch stats separate. This seems a bit much to get something so simple done.

This is rather simple, so all this does is.
- Renames the files table to global files and then add in more col to each user
- Creates a view on the master to act as the files table
- Then all the other users only have a bookmarks table and the rest are views

I know its a bit of code in the post and if you're new to MySQL then it's crazy jargon

Do you have MySQL up and running?
Do you have PHPMyAdmin, MySQL Workbench, MySQL CLI etc?
Have you got one Kodi install working from the DB?

If you have one working I Can help you setup the rest, just need to know the name of the DB Smile
Reply
A simpler solution for non tech people can be to use Emby (instead of MySQL) + Kodi.

This works great for the usual video database of Movies, etc, but unfortunately means that you lose watched and resume status being syncd across all your devices for other video addons such as youtube (and any other such addons).

This is a pity, if Emby would fix this then it would be close to a perfect solution.
If I have helped you or increased your knowledge please click the 'Thumb Up - Like' button to show me your appreciation :)
For YouTube questions see the official thread here.
Reply
So emby has per user watched status?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
As far as I understand, yes. For simplicity you still need multiple profiles on Kodi, and each of those will be logged into the Emby for Kodi addon as a different user too. But that's it as far as 'complexity' goes.

Then you just add those users and adjust some settings in the Emby Server Dashboard, but for non tech users that's much easier than MySQL and it's all in a windows style GUI too.

In addition there are quite good management features regarding what different users have access to both in terms of settings and actual content. Useful for a mixture of different family members.

https://github.com/MediaBrowser/Wiki/wiki/Users

"Users can have their own personalized media libraries, user data, recommendations, security settings, and more."

I found Emby to be generally brilliant as a server for Kodi during a quick test a while ago, and also an easy way to serve content to your devices from home to a remote or mobile location too.

However not being able to sync my watched and resume status for the more than 300 other (mainly streaming) Kodi video addons that are here http://addons.kodi.tv/category/video/ was just too much of a MySQL feature to lose for my purposes, and you cant run Emby + mySQL together. I watch a lot of (legal) streaming content from these Kodi video addons and it's essential that at least the watched status is syncd between all my devices for these video clips too.

I raised the issue in this thread http://emby.media/community/index.php?/t...-from-sql/ but was pretty much shot down. Pity because without this limitation it would be a no brainer to replace MySQL with Emby. As a server it seems very good.

If you have the same thoughts, please raise this issue on the Emby forums too.
If I have helped you or increased your knowledge please click the 'Thumb Up - Like' button to show me your appreciation :)
For YouTube questions see the official thread here.
Reply
(2015-08-13, 10:36)jmh2002 Wrote: A simpler solution for non tech people can be to use Emby (instead of MySQL) + Kodi.

This works great for the usual video database of Movies, etc, but unfortunately means that you lose watched and resume status being syncd across all your devices for other video addons such as youtube (and any other such addons).

This is a pity, if Emby would fix this then it would be close to a perfect solution.

I currently have it setup this way and it works perfect. i don't use video addons so that isn' an issue. Unfortunately, emby needs some work in the mobile apps so i was thinking about using plex until emby is up to par and use mysql inatead with kodi. I am not sure about this solution or maybe i just stick with emby.
Reply
Thanks for the good report.

Unless it's just a tiny device like a phone, why not just use Kodi (+ Emby) on the mobile device too? You could even run a different skin to help with this.

I much prefer the seamless experience in this respect when moving from device to device, and even use the same skin everywhere (even on my phone, even though it's too small really).
If I have helped you or increased your knowledge please click the 'Thumb Up - Like' button to show me your appreciation :)
For YouTube questions see the official thread here.
Reply
Kodi on the phone isn't ideal and I have not seen a single skin for kodi that works well on the phone.
Reply
@BingBong,

Were you able to test the new setup in more detail for Isengard?
I have not enough knowledge about databases to just take a leap and hope for the best. Smile
Reply
@Bohemi

No I havn't had time as of yet,
I hope to do more testing next weekend tho, I will provide an update once that is completed
Reply
Great to hear BigBong.
Good luck with testing!
Reply
would still also work if I have 3-5 Kodi clients, but only one user?
Reply
  • 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 26

Logout Mark Read Team Forum Stats Members Help
[MYSQL] HOW-TO: 5 User XBMC5