--
DELETE FROM `settings` where `value`='HostMyhostname';
--
INSERT INTO `settings` (`value`,`data`,`hostname`) VALUES ('HostMyhostname','type_hostname_here','apheleia');
--

-- set default settings for mythinstall/systemconfig programs
INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('Hostpluginmytharchive','1','apheleia'),
 ('Hostpluginmythbrowser','1','apheleia'),
 ('Hostpluginmythcontrols','1','apheleia'),
 ('Hostpluginmythnetvision','0','apheleia'),
 ('Hostpluginmythgallery','0','apheleia'),
 ('Hostpluginmythgame','1','apheleia'),
 ('HostpluginmythgameROMDB','0','apheleia'),
 ('Hostpluginmythgamefceux','0','apheleia'),
 ('Hostpluginmythgamesnes9x','0','apheleia'),
 ('HostpluginmythgameMame','1','apheleia'),
 ('HostpluginmythgameDolphin','0','apheleia'),
 ('HostpluginmythgameXe','0','apheleia'),
 ('HostpluginmythgameMednafen','0','apheleia'),
 ('HostpluginmythgameMupen64','0','apheleia'),
 ('Hostpluginmythmusic','1','apheleia'),
 ('Hostpluginmythnews','1','apheleia'),
 ('Hostpluginmythvideo_dvdcss','0','apheleia'),
 ('Hostpluginmythweather','1','apheleia'),
 ('Hostpluginmythzoneminder','0','apheleia'),
 ('Hostpluginmythappletrailers','1','apheleia'),
 ('HostBEWait','1','apheleia'),
 ('Hostupdateplan','Notify','apheleia'),
 ('HostAudiotype','ALSA','apheleia');

-- Clear out old values because mysql is mysql
DELETE from settings where value in
('WOLbackendReconnectWaitTime','AutoStartFrontend',
 'AllowQuitShutdown','BackendServerIP'
 'BackendServerIP6','HaltCommand'
 'RebootCommand','Theme'
 'LircSocket');

INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('WOLbackendReconnectWaitTime','5',NULL);

INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('AutoStartFrontend'     ,'1'                             , 'apheleia'),
 ('AllowQuitShutdown'     ,'4'                             , 'apheleia'),
 ('BackendServerIP'       ,'127.0.0.1'                     , 'apheleia'),
 ('BackendServerIP6'      ,'::1'                           , 'apheleia'),
 ('HaltCommand'           ,'sudo /sbin/halt'               , 'apheleia'),
 ('RebootCommand'         ,'sudo /sbin/reboot'             , 'apheleia'),
 ('Theme'                 ,'LinHES'                        , 'apheleia'),
 ('ThemePainter'          ,'auto'                          , 'apheleia'),
 ('LircSocket'            ,'/var/run/lirc/lircd'           , 'apheleia');
--

INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('NonID3FileNameFormat'        ,'GENRE/ARTIST/ALBUM/TRACK_TITLE' , 'apheleia'),
 ('CDDevice'                    ,'/dev/cdrom'                     , 'apheleia'),
 ('MusicAudioDevice'            ,'default'                        , 'apheleia'),
 ('MythArchiveCopyRemoteFiles'  ,'1'                              , 'apheleia'),
 ('GalleryDir'                  ,'/myth/gallery'                  , 'apheleia'),
 ('MusicLocation'               ,'/myth/music/'                   , 'apheleia'),
 ('mythgame.screenshotdir'      ,'/myth/games/screenshots'        , 'apheleia'),
 ('mythgame.fanartdir'          ,'/myth/games/fanart'             , 'apheleia'),
 ('mythgame.boxartdir'          ,'/myth/games/boxart'             , 'apheleia'),
 ('MythArchiveTempDir'          ,'/myth/tmp'                      , 'apheleia');


-- MythVideo old local dir..replaced by storage groups, but should set values to null

INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
('ScreenShotPath'              ,''  , 'apheleia'),
('VideoStartupDir'             ,''  , 'apheleia'),
('mythvideo.TrailersDir'       ,''  , 'apheleia'),
('VideoArtworkDir'             ,''  , 'apheleia'),
('mythvideo.screenshotDir'     ,''  , 'apheleia'),
('mythvideo.bannerDir'         ,''  , 'apheleia'),
('mythvideo.fanartDir'         ,''  , 'apheleia');

-- MythVideo old local dir..replaced by storage groups
/*
INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('ScreenShotPath'              ,'/myth/artwork/screenshots'  , 'apheleia'),
 ('VideoStartupDir'             ,'/myth/video'                    , 'apheleia'),
 ('mythvideo.TrailersDir'       ,'/myth/artwork/trailers'     , 'apheleia'),
 ('VideoArtworkDir'             ,'/myth/artwork/coverart'     , 'apheleia'),
 ('mythvideo.screenshotDir'     ,'/myth/artwork/screenshots'  , 'apheleia'),
 ('mythvideo.bannerDir'         ,'/myth/artwork/banners'      , 'apheleia'),
 ('mythvideo.fanartDir'         ,'/myth/artwork/fanart'       , 'apheleia');
*/


-- /myth based storage groups are obsolete, add_storage.py will create the ones it needs.
-- INSERT INTO `storagegroup` (`groupname`, `hostname`, `dirname`) VALUES
--  ('Default'     ,'apheleia'    ,'/myth/tv/'),
--  ('LiveTV'      ,'apheleia'    ,'/myth/tv/live/'),
--  ('Screenshots' ,'apheleia'    ,'/myth/artwork/screenshots/'),
--  ('Videos'      ,'apheleia'    ,'/myth/video/'),
--  ('Coverart'    ,'apheleia'    ,'/myth/artwork/coverart/'),
--  ('Banners'     ,'apheleia'    ,'/myth/artwork/banners/'),
--  ('Fanart'      ,'apheleia'    ,'/myth/artwork/fanart/'),
--  ('Trailers'    ,'apheleia'    ,'/myth/artwork/trailers/'),
--  ('Streaming'   ,'apheleia'    ,'/myth/streaming'),
--  ('DB Backups'  ,'apheleia'    ,'/data/storage/disk0/backup/mythtv_backups/');


-- Clear out old values because mysql is mysql
DELETE from settings where value in
('OverrideExitMenu','NetworkControlEnabled''SecurityPin',
 'BackendStopCommand',
 'BackendStartCommand');

INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
('OverrideExitMenu','3','apheleia'),
('NetworkControlEnabled','1','apheleia'),
('SecurityPin','0000','apheleia'),
('BackendStopCommand','sudo sv stop mythbackend' ,NULL),
('BackendStartCommand','sudo sv start mythbackend' ,NULL);

--

-- Clear out old user jobs
DELETE FROM `settings` where value in
('JobAllowUserJob1',
 'JobAllowUserJob2',
 'JobAllowUserJob3',
 'JobAllowUserJob4',
 'UserJob1',
 'UserJob2',
 'UserJob3',
 'UserJob4',
 'UserJobDesc1',
 'UserJobDesc2',
 'UserJobDesc3',
 'UserJobDesc4');


INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
 ('JobAllowUserJob1','1','apheleia'),
 ('JobAllowUserJob2','1','apheleia'),
 ('JobAllowUserJob3','1','apheleia'),
 ('JobAllowUserJob4','0','apheleia'),
 ('UserJob1','/usr/LH/bin/mythvidexport.py %JOBID%','apheleia'),
 ('UserJob2','/usr/LH/bin/myth2mkv "%DIR%/%FILE%" "%CHANID%" "%STARTTIME%" "%TITLE%" "%SUBTITLE%" "%JOBID%" "HP"','apheleia'),
 ('UserJob3','/usr/LH/bin/myth2mp3 "%DIR%/%FILE%" "%TITLE% - %SUBTITLE%" "%CHANID%" "%STARTTIME%"','apheleia'),
 ('UserJob4','','apheleia'),
 ('UserJobDesc1','Copy to Videos','apheleia'),
 ('UserJobDesc2','Encode to x264 mkv','apheleia'),
 ('UserJobDesc3','Encode Audio to mp3','apheleia'),
 ('UserJobDesc4','','apheleia');
--



INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
('MiscStatusScript','/usr/LH/bin/misc_status_info.sh','apheleia');


UPDATE `keybindings`  set `keylist` = "Alt+Esc" WHERE `action` = 'EXITPROMPT' ;

-- Force windowmanager to enlightnemnet, install supplemental and use enhanced
INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
('HostWindowManager'  , 'enlightenment' ,'apheleia'),
('HOSTSupplemental'   , '1'             ,'apheleia'),
('HostEnhancedWMStyle', '1'             ,'apheleia');


--  Defaults for OS install
INSERT INTO `settings` (`value`, `data`, `hostname`) VALUES
('HOSTuprootfstype','ext4' ,   'apheleia'),
('HOSTOSsize',      '5'    ,   'apheleia'),
('HOSTrootfstype',  'ext4' ,   'apheleia'),
('HOSTHOMEsize',    '5'    ,   'apheleia'),
('HOSTDatabasesize','2'    ,   'apheleia'),
('HostUseSWAP',     '1'    ,   'apheleia'),
('HostUseALLdata',  '1'    ,   'apheleia'),
('HOSTdatafstype',  'xfs'  ,   'apheleia');

-- Add a dummy tuner so BE will at least start
INSERT INTO `capturecard` (`videodevice`,`cardtype`,`defaultinput`,`hostname`,`sourceid`) VALUES
('file://tmp/demo.mpg' , 'DEMO', 'Television', 'apheleia', '1');

INSERT INTO `videosource` (`name`, `xmltvgrabber`) VALUES
('DEMO_VIDEO_SOURCE' , '/bin/true');