2016-04-27, 22:20
What does the "TRIGGER FIX FOR MULT USERS" part actually do?
/* TRIGGER FIX FOR MULT USERS */
DROP TRIGGER IF EXISTS `Kodi_Test_Matt_Video_99`.`delete_file`;
DELIMITER $$
/* REPLACE ---> KODI <--- WITH YOUR MYSQL LOGIN UID FROM THE ADVANCEDSETTINGS.XML */
CREATE DEFINER=`KODI`@`%` TRIGGER `Kodi_Test_Matt_Video_99`.`delete_file` AFTER DELETE
ON `Kodi_Test_Matt_Video_99`.`globalfiles`
FOR EACH ROW
BEGIN
DELETE FROM `Kodi_Test_Matt_Video_99`.bookmark WHERE idfile = old.idfile;
DELETE FROM `Kodi_Test_Mace_Video_99`.bookmark WHERE idfile = old.idfile;
DELETE FROM `Kodi_Test_Kiyana_Video_99`.bookmark WHERE idfile = old.idfile;
DELETE FROM `Kodi_Test_Jaide_Video_99`.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 ;
(2016-05-04, 18:23)npbhdk Wrote: I attempted to use the 99 instructions, didnt get any errors when using the sql. But kodi seems to fail at inserting data into the views.If I understand right, you are using all systems Master and Slaves to scan for media? (I have found its best to use only the one system Master or Slave to import, as when you do a scan on a different user it will redo the whole TV Shows as the Hash changes (Haven't looked too far into why that is))
i get errors like this when i attempt to scan files
18:19:34 T:944 ERROR: SQL: [Niels_Video_99] Undefined MySQL error: Code (1471) Query: insert into files (idFile, idPath, strFileName) values(NULL, 8, lots-tfoftr.mkv')
18:19:34 T:944 ERROR: CVideoDatabase::AddFile unable to addfile ()
and
18:19:17 T:5900 ERROR: SQL: [Niels_Video_99] Undefined MySQL error: Code (1471) Query: insert into path (idPath, strPath) values (NULL, 'smb://N-HTPC-PC/tv2/')
18:19:17 T:5900 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath) values (NULL, 'smb://N-HTPC-PC/tv2/'))
when attempting to change content type of a source this works when i use the master database in the advancedsettingsfile scanning for content does not
(2016-05-05, 16:06)BigMong Wrote: @npbhdk
(2016-05-04, 18:23)npbhdk Wrote: I attempted to use the 99 instructions, didnt get any errors when using the sql. But kodi seems to fail at inserting data into the views.If I understand right, you are using all systems Master and Slaves to scan for media? (I have found its best to use only the one system Master or Slave to import, as when you do a scan on a different user it will redo the whole TV Shows as the Hash changes (Haven't looked too far into why that is))
i get errors like this when i attempt to scan files
18:19:34 T:944 ERROR: SQL: [Niels_Video_99] Undefined MySQL error: Code (1471) Query: insert into files (idFile, idPath, strFileName) values(NULL, 8, lots-tfoftr.mkv')
18:19:34 T:944 ERROR: CVideoDatabase::AddFile unable to addfile ()
and
18:19:17 T:5900 ERROR: SQL: [Niels_Video_99] Undefined MySQL error: Code (1471) Query: insert into path (idPath, strPath) values (NULL, 'smb://N-HTPC-PC/tv2/')
18:19:17 T:5900 ERROR: CVideoDatabase::AddPath unable to addpath (insert into path (idPath, strPath) values (NULL, 'smb://N-HTPC-PC/tv2/'))
when attempting to change content type of a source this works when i use the master database in the advancedsettingsfile scanning for content does not
By the looks of the errors its trying to INSERT into a non insertable view, I would check that you can view data in that view "files" that is linked to "globalfiles" does the Master and Slave connect to the DB with the same Login? Does the login being used have All Privileges to the view?
@RonM
Thank You, Glad you are loving it, OpenELEC on some RPI2 or 3's work awesome around the house, and now a few streets over, over a PTP WiFi network
RENAME TABLE `Sushi99`.`files` TO `Sushi99`.`globalfiles`;
ALTER TABLE `Sushi99`.`globalfiles` CHANGE playCount playCountSushi INT(11);
ALTER TABLE `Sushi99`.`globalfiles` CHANGE lastPlayed lastPlayedSushi TEXT;
ALTER TABLE `Sushi99`.`globalfiles` ADD playCountChloe INT(11) AFTER lastPlayedSushi;
ALTER TABLE `Sushi99`.`globalfiles` ADD lastPlayedChloe TEXT AFTER playCountChloe;
ALTER TABLE `Sushi99`.`globalfiles` ADD playCountFelicia INT(11) AFTER lastPlayedChloe;
ALTER TABLE `Sushi99`.`globalfiles` ADD lastPlayedFelicia TEXT AFTER playCountFelicia;
CREATE VIEW `Sushi99`.`files` AS SELECT
`Sushi99`.`globalfiles`.`idFile` AS `idFile`,
`Sushi99`.`globalfiles`.`idPath` AS `idPath`,
`Sushi99`.`globalfiles`.`strFilename` AS `strFilename`,
`Sushi99`.`globalfiles`.`playCountSushi` AS `playCount`,
`Sushi99`.`globalfiles`.`lastPlayedSushi` AS `lastPlayed`,
`Sushi99`.`globalfiles`.`dateAdded` AS `dateAdded`
FROM `Sushi99`.`globalfiles`;
16:48:27 T:9872 DEBUG: CInputManager::OnKey: w (0xf057) pressed, action is ToggleWatched
16:48:27 T:2948 DEBUG: Mysql Start transaction
16:48:27 T:2948 DEBUG: Mysql execute: update files set playCount=NULL,lastPlayed=NULL where idFile=2
16:48:27 T:2948 ERROR: SQL: [sushi99] Undefined MySQL error: Code (1288)
Query: update files set playCount=NULL,lastPlayed=NULL where idFile=2
16:48:27 T:2948 ERROR: CVideoDatabase::SetPlayCount failed
16:48:27 T:2948 DEBUG: Mysql commit transaction
update files set playCount=NULL,lastPlayed=NULL where idFile=2
if (!date.IsValid())
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed=NULL where idFile=%i", id);
else
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed='%s' where idFile=%i", date.GetAsDBDateTime().c_str(), id);
}
(2016-06-28, 14:43)BigMong Wrote: @Sushi7
I spotted that error and I have tested the manually running the SQL
it's strange that it works when your watch an episode but that is calling a different SQL string
After a few mins looking at the source on GitHub https://github.com/xbmc/xbmc
In the /xbmc/video/VideoDatabase.cpp file, line 5155 I believe is the SQL that is Prepared
Code:if (!date.IsValid())
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed=NULL where idFile=%i", id);
else
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed='%s' where idFile=%i", date.GetAsDBDateTime().c_str(), id);
}
I will setup my 16.1 Kodi again and do some testing over the weekend
(2016-07-28, 11:28)gaxander Wrote:(2016-06-28, 14:43)BigMong Wrote: @Sushi7
I spotted that error and I have tested the manually running the SQL
it's strange that it works when your watch an episode but that is calling a different SQL string
After a few mins looking at the source on GitHub https://github.com/xbmc/xbmc
In the /xbmc/video/VideoDatabase.cpp file, line 5155 I believe is the SQL that is Prepared
Code:if (!date.IsValid())
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed=NULL where idFile=%i", id);
else
strSQL = PrepareSQL("update files set playCount=NULL,lastPlayed='%s' where idFile=%i", date.GetAsDBDateTime().c_str(), id);
}
I will setup my 16.1 Kodi again and do some testing over the weekend
Have you made any progress??