* remove database entries containing processed filename */ & TRIGGER_FIRED_BEFORE(trigdata->tg_event)) If (!TRIGGER_FIRED_BY_DELETE(trigdata->tg_event) If (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event)) * make sure it's called as a trigger at all */Įlog(ERROR, 'aftertaskcompleted: not called by trigger manager') TriggerData *trigdata = (TriggerData *) fcinfo->context and relations */Įxtern Datum aftertaskcompleted(PG_FUNCTION_ARGS) #include 'executor/spi.h' /* this is what you need to work with SPI */ STEP 1: Install PSQL headers, and compile the following PSQL C function: (download folder, plex media folder, scripts folder, filebot, java).Įasiest is to use synogroup to add postgres to a group that already has permissions. NOTE: you need to give the Synology user 'postgres' access to all the required paths The bash script outputs the recognized files to the PSQL C function, which removes completedĭownloads containing those files from the database (and from DownloadStation GUI). The bash script is responsible for running FileBot and notifying Plex server of new files. This method involves creating a PSQL trigger, and PSQL C function which runs a bash script. logInfo ( ' executed ' ) 191 except Exception, e : 192 self. append ( folder ) 187 188 try : 189 subprocess. getConfig ( ' music ' ) ) 180 else : 181 args. getConfig ( ' series ' ) ) 177 178 if self. getConfig ( ' movie ' ) ) 174 175 if self. getConfig ( ' plex ' ) ) 171 172 if self. getConfig ( ' xbmc ' ) ) 168 169 if self. getConfig ( ' pushbullet ' ) ) 165 166 if self. getConfig ( ' pushover ' ) ) 162 163 if self. getConfig ( ' myepisodespw ' ) ) 159 160 if self. getConfig ( ' myepisodes ' ) + ' : ' + self. getConfig ( ' myepisodespw ' ) : 158 args. getConfig ( ' gmailpw ' ) ) 156 157 if self. getConfig ( ' ignore ' ) ) 153 154 if self. getConfig ( ' subtitles ' ) ) 150 151 if self. getConfig ( ' artwork ' ) ) 147 148 if self. getConfig ( ' reperror ' ) ) 144 145 if self. getConfig ( ' excludeList ' ) ) 141 142 if self. getConfig ( ' excludeList ' ) : 140 args. append ( ' skipExtract=y ' ) 138 139 if self. getConfig ( ' exec ' ) ) 130 131 # start with all definitions: 132 args. getConfig ( ' lang ' ) ) 127 128 if self. getConfig ( ' destination ' ) ) 120 else : 121 args. getConfig ( ' destination ' ) : 118 args. getConfig ( ' action ' ) ) 116 117 if self. getConfig ( ' conflict ' ) ) 113 114 args. getConfig ( ' filebot ' ) ) 98 else : 99 args. Finished ( folder ) 91 92 def Finished ( self, folder ) : 93 94 args = # 95 96 if self. Finished ( folder ) 88 89 def unrarFinished ( self, folder, fname ) : 90 self. Finished ( folder ) 83 84 # TODO must be checked for functionality 85 def allDownloadsFinished ( self ) : 86 folder = self. 16 17 import subprocess 18 19 from import Hook 20 21 22 class FileBot ( Hook ) : 23 _name_ = " FileBot " 24 _version_ = " 0.5 " 25 _config_ = 72 73 _description_ = " Automated renaming and sorting for tv episodes movies, music and animes " 74 _author_name_ = ( " Gutz-Pilz ", " Branko Wilhelm ", " Kotaro " ) 75 _author_mail_ = ( " ", " ", " " ) 76 77 event_list = 78 79 # TODO must be checked for functionality 80 def packageFinished ( self, pypack ) : 81 folder = self. 13 # 14 # You should have received a copy of the GNU General Public License 15 # along with this program. See the 12 # GNU General Public License for more details. 8 # 9 # This program is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Raw file 1 # !/usr/bin/python 2 # -*- coding: utf-8 -*- 3 4 # This program is free software: you can redistribute it and/or modify 5 # it under the terms of the GNU General Public License,published by 6 # the Free Software Foundation, either version 3 of the License, or 7 # (at your option) any later version.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |