•   
  • 1
  • 9
  • 10
  • 11(current)
  • 12
  • 13
  • 23
  •   
[MYSQL] HOW-TO: 5 User XBMC
i need help for instalatie please
Reply
@nekrosoft13

That's the easy setup just put the same info in each of your advancedsettings.xml

From my file to give you some ideas:

Code:
<advancedsettings>
  <samba>
    <clienttimeout>30</clienttimeout>
  </samba>
  <network>
    <disableipv6>true</disableipv6>
  </network>
  <videodatabase>
    <type>mysql</type>
    <host>192.168.0.41</host>
    <port>3306</port>
    <user>%SQLUID%</user>
    <pass>%SQLPWD%</pass>
    <name>Kodi_Video</name>
  </videodatabase>
</advancedsettings>

Then all clients will connect to the same database, would recommend to only do import from one system but it will work still if all do it (just takes much longer)

This setup is on the kodi wiki too Smile

@quim_3000
Need some more information, the guides on here assume you have Kodi installed on your platform of choose and have a working MySQL server running
Reply
(2015-08-02, 16:59)BigMong Wrote: 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

I am going to attempt this. I've already backed up both profiles video databases to single files, separately. I previously used your posts and the scripts from bigmong to upgrade from Gotham to Helix. This post is a little more confusing...

I have a b c d e in the SQL database, and the two of which I really use are a (master) b (secondary). c is set up to be able to login as a guest on the clients.
I understand the find and replace part so the scripts will have a_93 instead of Kodi_Matt_Video_93.
I will find and replace Kodi_Mace_Video_ with b, Kodi_Kiyana_Video_ with c
I understand how I would add a fifth user based on your globalfiles script.

I have few questions so far:
I guess I should change playCountMatt and lastPlayedMatt to playCounta and lastPlayeda, respectively? and then carry on with b and c in place of Mace and Kiyana?
Do I run all of these scripts with the master user database (a) selected?
Reply
(2015-09-02, 03:49)bmac88 Wrote:
(2015-08-02, 16:59)BigMong Wrote: 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

I am going to attempt this. I've already backed up both profiles video databases to single files, separately. I previously used your posts and the scripts from bigmong to upgrade from Gotham to Helix. This post is a little more confusing...

I have a b c d e in the SQL database, and the two of which I really use are a (master) b (secondary). c is set up to be able to login as a guest on the clients.
I understand the find and replace part so the scripts will have a_93 instead of Kodi_Matt_Video_93.
I will find and replace Kodi_Mace_Video_ with b, Kodi_Kiyana_Video_ with c
I understand how I would add a fifth user based on your globalfiles script.

I have few questions so far:
I guess I should change playCountMatt and lastPlayedMatt to playCounta and lastPlayeda, respectively? and then carry on with b and c in place of Mace and Kiyana?
Do I run all of these scripts with the master user database (a) selected?

Sorry for the delay, I still havn't had time to do more testing. Sad

Ok to the questions Smile
The SQL should work from the root level of your DB so no need for DB "a" to be selected Smile
with the play counts yes you can change them, just remember to update the "file" table as below for user "a" (The view that gets data from "globalfiles")

Code:
CREATE VIEW `a_93`.`files`
    AS SELECT
      `globalfiles`.`idFile` AS `idFile`,
      `globalfiles`.`idPath` AS `idPath`,
      `globalfiles`.`strFilename` AS `strFilename`,
      `globalfiles`.`playCounta` AS `playCount`,
      `globalfiles`.`lastPlayeda` AS `lastPlayed`,
      `globalfiles`.`dateAdded` AS `dateAdded`
    FROM `a_93`.`globalfiles`;

also note I like to leave the word "Video" in each DB just in-case music is added and its the same DB ver number (Prob never going to happen but I like to make it look pretty too)
Reply
I'm about to try this on my Windows box (not the Ubuntu primary machine) first so that if it doesn't work properly I can revert. Easier to revert to Kodi 14.2 in Windows than messing around downgrading.deb packages in Ubuntu... I don't see why it wouldn't work? I have path substitution setup for the Thumbnails to the main server anyways, and I backed up the .kodi directory as well as the SQL database to be safe.

EDIT: I'm noticing all of your non-primary (2,3,4) user scripts have this reference (below) to Jaide, which is User4? what is that actually supposed to be? Also I got this error:

/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TRIGGER IF EXISTS `a93`.`delete_person`' at line 6 */

Code:
CREATE VIEW `b93`.`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 `a93`.`globalfiles`;

EDIT 2: OK so I assume that I change Jaide to b c and d for user1 user2 and user3 scripts, respectively. (Please correct me if I'm wrong.)

That still leaves the SQL Error (1064) that I can't get past. I'm using HeidiSQL 8.3.0.4694
Reply
I have been dropping all of the existing tables (a b c d e) from the MySQL library, starting Kodi 15.1, it creates the new table a93, I wait a few seconds then close it.

Does this have anything to do with the SQL error I get when I try to run your queries?
Reply
Knowing the dependency for rolling to the new kodi releases every time, I started testing Emby as mediaserver on the background and it indeed looks like it can fully replace this multi user SQL. Probably it will use more server cpu but it's much more easy to maintain for a basic user like myself.
Reply
In general I agree as I have posted elsewhere about Emby, and the added user controls will be nice for people with family and children. But yes it seems to use more cpu, and a lot more ram.

The only thing missing is that it doesn't sync your watched and resumed status for any of the other 300+ Kodi video addons (eg: youtube, etc) and because of the way Emby for Kodi has been implemented it actually prevents you from using MySQL to continue to do this. Its a real pity.
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
I would try Emby, but it seems cumbersome for something that I know can work with what I already have. I feel like I would be giving up if I didn't figure out these upgrade scripts that BigMong wrote. I'm sticking with 14.2 for now. I tried figuring out the SQL client that he was using (PHPMyAdmin) but it doesn't seem to be an application that you simply install. I'll be patient and see if he gets time to figure out the syntax error I've been getting when running his queries.
Reply
I wouldn't say Emby is cumbersome at all. It might be a little confusing looking at their website but really it's not. After installation it took me less than 10 minutes to have it up and running.

Its way easier than MySQL for most people, especially when you have multiple profiles and both internal and external access.

I posted this in another thread:

(2015-09-11, 11:07)jmh2002 Wrote: For the most part the setup is: Install Emby Server on a machine at your house and point to to the media files on the hard drive. After, install the Emby for Kodi addon on each instance of Kodi.

Done.

(ok yes, there is a lot more tweaking to get it 'just right' but those are the basic steps, its very easy).

Get Emby Server from their website. Get Emby for Kodi from their Kodi Repo.
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
have a log cpu screen running on top of screen im watching how do I remove please help thanks
Reply
@BigMong, thanks for posting the SQL changes, i think i have it working properly. Its a shame how with each upgraded kodi release this process seems to get more and more complicated.

I have googled around like crazy, but is anyone aware of a method to accomplish this without altering the "main" user DB?

more often then now i end up shifting my main user DB around (dump/rebuild) i worry this method will be a real challenge to maintain each time i do that.
Reply
@apeg, i understand your struggle.
I switched to Emby for Kodi a month ago to test stability and functionality and to review if it's a full replacer for SQL 5 user setup. This with the thought that it would be easier to update to new Kodi releases knowing that I wan't to be able to make use of the newest functionality every time.
So far I am positively surprised about the capabilities. For sure it uses more cpu from the server then SQL but I have the spare capacity available so no problem, from the other hand you have much more control over user authorizations and your metadata management is much smoother. I won't be even bother to figure out a fix for the database anymore in SQL...Emby and Kodi work together nicely. At least this is the opinion of a less advanced user...For me the user experience is priority 1.
Reply
If i have to bite the bullet and edit my master_db i will... but reading the posts there isn't much confirmation that BigMong method works. can anyone comment if that's the case before is start messing around with my master_db? Also (assuming it is working) along with adding users to the globalfiles table do we not also have to run the "ALTER TABLE" queries for the new users as shown in the GlobalFiles and Triggers section?
Code:
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;

Thanks guys,

** what i would give for a check box in the setting section to store bookmarks and watch status locally :-S
Reply
+1 for Emby server. I was lookimg at MySQL server for a typical home setup (2 Kodi boxes), and MySQL seemed like overkill to.me anyways. I tried Emby and had everything up in a day, after some initial glitches. Their forum users are just as supportive as anywhere I was served.

I get the concerns regarding the Freemium model, but frankly for basic functionality, it works and is free. Until that changes, I dont need to worry...
Primary Sony 85" X8500F LED, Yamaha RX-V685, Odroid N2 4GB running CoreElec 9.2.0 (Kodi Leia 18.4), SVS 5.1 Sound
Secondary Panasonic 50" ST50 Plasma, Pioneer AV916, Asus Chromebox running LibreElec (Kodi Leia)
Reply
  •   
  • 1
  • 9
  • 10
  • 11(current)
  • 12
  • 13
  • 23
  •   



Logout Mark Read Team Forum Stats Members Help
[MYSQL] HOW-TO: 5 User XBMC5
This forum uses Lukasz Tkacz MyBB addons.