mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 19:07:44 +01:00
Config option for folder permissions
This commit is contained in:
@@ -105,6 +105,7 @@ LASTFM_USERNAME = None
|
||||
MEDIA_FORMATS = ["mp3", "flac", "aac", "ogg", "ape", "m4a"]
|
||||
|
||||
INTERFACE = None
|
||||
FOLDER_PERMISSIONS = None
|
||||
|
||||
def CheckSection(sec):
|
||||
""" Check if INI section exists, if not create it """
|
||||
@@ -163,7 +164,7 @@ def initialize():
|
||||
ADD_ALBUM_ART, EMBED_ALBUM_ART, DOWNLOAD_DIR, BLACKHOLE, BLACKHOLE_DIR, USENET_RETENTION, NZB_SEARCH_INTERVAL, \
|
||||
LIBRARYSCAN_INTERVAL, DOWNLOAD_SCAN_INTERVAL, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \
|
||||
NZBMATRIX, NZBMATRIX_USERNAME, NZBMATRIX_APIKEY, NEWZNAB, NEWZNAB_HOST, NEWZNAB_APIKEY, \
|
||||
NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, LASTFM_USERNAME, INTERFACE
|
||||
NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS
|
||||
|
||||
if __INITIALIZED__:
|
||||
return False
|
||||
@@ -241,6 +242,7 @@ def initialize():
|
||||
LASTFM_USERNAME = check_setting_str(CFG, 'General', 'lastfm_username', '')
|
||||
|
||||
INTERFACE = check_setting_str(CFG, 'General', 'interface', 'default')
|
||||
FOLDER_PERMISSIONS = check_setting_str(CFG, 'General', 'folder_permissions', '0755')
|
||||
|
||||
if not LOG_DIR:
|
||||
LOG_DIR = os.path.join(DATA_DIR, 'logs')
|
||||
@@ -408,6 +410,7 @@ def config_write():
|
||||
|
||||
new_config['General']['lastfm_username'] = LASTFM_USERNAME
|
||||
new_config['General']['interface'] = INTERFACE
|
||||
new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS
|
||||
|
||||
new_config.write()
|
||||
|
||||
|
||||
@@ -306,10 +306,12 @@ def moveFiles(albumpath, release, tracks):
|
||||
|
||||
# Chmod the directories using the folder_format (script courtesy of premiso!)
|
||||
folder_list = folder.split('/')
|
||||
|
||||
|
||||
temp_f = os.path.join(headphones.DESTINATION_DIR);
|
||||
for f in folder_list:
|
||||
temp_f = os.path.join(temp_f, f)
|
||||
os.chmod(temp_f, 0755)
|
||||
os.chmod(temp_f, int(headphones.FOLDER_PERMISSIONS, 8))
|
||||
|
||||
except Exception, e:
|
||||
logger.error('Could not create folder for %s. Not moving: %s' % (release['AlbumTitle'], e))
|
||||
|
||||
Reference in New Issue
Block a user