@Override
 protected void writeToConfig() {
   int maxGiB = myTranscodingCacheMaxGiB.getIntegerValue(1);
   MyTunesRss.CONFIG.setTranscodingCacheMaxGiB(maxGiB);
   MyTunesRss.TRANSCODER_CACHE.setMaxSizeBytes((long) maxGiB * 1024L * 1024L * 1024L);
   maxGiB = myHttpLiveStreamCacheMaxGiB.getIntegerValue(5);
   MyTunesRss.CONFIG.setHttpLiveStreamCacheMaxGiB(maxGiB);
   MyTunesRss.HTTP_LIVE_STREAMING_CACHE.setMaxSizeBytes((long) maxGiB * 1024L * 1024L * 1024L);
   String vlcBinary = myVlcBinary.getStringValue(null);
   File vlcExecutable = vlcBinary != null ? new File(vlcBinary) : null;
   if (vlcExecutable != null
       && vlcExecutable.isDirectory()
       && SystemUtils.IS_OS_MAC_OSX
       && "vlc.app".equalsIgnoreCase(vlcExecutable.getName())) {
     vlcExecutable = new File(vlcExecutable, "Contents/MacOS/VLC");
   }
   MyTunesRss.CONFIG.setVlcExecutable(vlcExecutable);
   MyTunesRss.CONFIG.setVlcEnabled(myVlcEnabled.booleanValue());
   Set<TranscoderConfig> deletedTranscoders = new HashSet<>();
   for (TranscoderConfig transcoderConfig : MyTunesRss.CONFIG.getTranscoderConfigs()) {
     deletedTranscoders.add(transcoderConfig);
   }
   for (TranscoderConfig transcoderConfig : myTranscoderConfigs) {
     deletedTranscoders.remove(transcoderConfig);
   }
   for (TranscoderConfig deletedTranscoder : deletedTranscoders) {
     LOGGER.debug(
         "Transcoder config \""
             + deletedTranscoder.getName()
             + "\" has been removed, truncating cache.");
     MyTunesRss.TRANSCODER_CACHE.deleteByPrefix(deletedTranscoder.getCacheFilePrefix());
   }
   MyTunesRss.CONFIG.setTranscoderConfigs(myTranscoderConfigs);
   MyTunesRss.CONFIG.save();
 }
 @Override
 protected void writeToConfig() {
   MyTunesRss.CONFIG.setAdminEmail(myAdminEmail.getStringValue(null));
   MyTunesRss.CONFIG.setNotifyOnDatabaseUpdate((Boolean) myNotifyOnDatabaseUpdate.getValue());
   MyTunesRss.CONFIG.setNotifyOnEmailChange((Boolean) myNotifyOnEmailChange.getValue());
   MyTunesRss.CONFIG.setNotifyOnInternalError((Boolean) myNotifyOnInternalError.getValue());
   MyTunesRss.CONFIG.setNotifyOnLoginFailure((Boolean) myNotifyOnLoginFailure.getValue());
   MyTunesRss.CONFIG.setNotifyOnMissingFile((Boolean) myNotifyOnMissingFile.getValue());
   MyTunesRss.CONFIG.setNotifyOnPasswordChange((Boolean) myNotifyOnPasswordChange.getValue());
   MyTunesRss.CONFIG.setNotifyOnQuotaExceeded((Boolean) myNotifyOnQuotaExceeded.getValue());
   MyTunesRss.CONFIG.setNotifyOnTranscodingFailure(
       (Boolean) myNotifyOnTranscodingFailure.getValue());
   MyTunesRss.CONFIG.setNotifyOnWebUpload((Boolean) myNotifyOnWebUpload.getValue());
   MyTunesRss.CONFIG.setNotifyOnOutdatedItunesXml(
       (Boolean) myNotifyOnOutdatedItunesXml.getValue());
   MyTunesRss.CONFIG.setNotifyOnSkippedDatabaseUpdate(
       (Boolean) myNotifyOnSkippedDatabaseUpdate.getValue());
   MyTunesRss.CONFIG.save();
 }
示例#3
0
 @Override
 protected void writeToConfig() {
   MyTunesRss.CONFIG.setWebLoginMessage(myWebLoginMessage.getStringValue(null));
   MyTunesRss.CONFIG.setWebWelcomeMessage(myWebWelcomeMessage.getStringValue(null));
   MyTunesRss.CONFIG.setServerBrowserActive(myServerBrowserActive.booleanValue());
   MyTunesRss.CONFIG.setOpenIdActive(myOpenIdActive.booleanValue());
   MyTunesRss.CONFIG.setProxyHost(myProxyHost.getStringValue(null));
   MyTunesRss.CONFIG.setProxyPort(myProxyPort.getIntegerValue(-1));
   MyTunesRss.CONFIG.setMailHost(myMailHost.getStringValue(null));
   MyTunesRss.CONFIG.setMailPort(myMailPort.getIntegerValue(-1));
   MyTunesRss.CONFIG.setSmtpProtocol((SmtpProtocol) mySmtpProtocol.getValue());
   MyTunesRss.CONFIG.setMailLogin(myMailLogin.getStringValue(null));
   MyTunesRss.CONFIG.setMailPassword(myMailPassword.getStringValue(null));
   MyTunesRss.CONFIG.setMailSender(myMailSender.getStringValue(null));
   MyTunesRss.CONFIG.setHeadless(myHeadless.booleanValue());
   String gmBinary = myGraphicsMagickBinary.getStringValue(null);
   MyTunesRss.CONFIG.setGmExecutable(gmBinary != null ? new File(gmBinary) : null);
   MyTunesRss.CONFIG.setGmEnabled(myGraphicsMagickEnabled.booleanValue());
   MyTunesRss.CONFIG.save();
 }