Permalink
Browse files

allow #--TRANSCODE--# folder name to be customized (GC963)

add missing (profile) name documentation to PMS.conf
  • Loading branch information...
1 parent fb5b427 commit 86466daa93134dcf2c960cbbda13db17341f92b1 @chocolateboy chocolateboy committed Jul 18, 2012
View
@@ -7,6 +7,8 @@ Changelog:
Add support for new web protocols: mmsh:// and mmst://
Sort files alphanumerically by default e.g. Episode 2 before Episode 10
Localized #--TRANSCODE--# folder name
+ PMS.conf:
+ - Added transcode_folder_name option to allow #--TRANSCODE--# folder name to be customized (issue GC963)
1.60.0 - 2012-07-17
@@ -33,6 +33,19 @@
# ----------------------------------------------------------------------------
# ---< General Settings >-----------------------------------------------------
+# Profile Name
+# --------------
+# An optional identifier used to distinguish this profile (i.e. collection of settings)
+# from other profiles. The profile name is displayed in the renderer in square
+# brackets after the software name e.g.
+#
+# PS3 Media Server [myprofile]
+#
+# If not set, it defaults to the hostname.
+# See the FAQ for details on how to create and use multiple profiles:
+# http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=3507&p=49895#p49895
+name =
+
# Interface Language
# -------------------
# GUI option: Language (selector)
@@ -262,6 +275,12 @@ hidevideosettings = false
# folder provide control over transcoding of video. Default value is false.
hide_transcode_folder = false
+# Transcode Folder Name
+# ---------------------
+# Assign a different name to the #--TRANSCODE--# folder e.g. "Subtitles" or "Languages".
+# If not set, the localized version of "#--TRANSCODE--#" is used.
+transcode_folder_name =
+
# Hide file extensions
# --------------------
# GUI Option: Hide file extensions (toggle)
@@ -158,6 +158,7 @@
private static final String KEY_THUMBNAIL_GENERATION_ENABLED = "thumbnails"; // TODO (breaking change): should be renamed to e.g. generate_thumbnails
private static final String KEY_THUMBNAIL_SEEK_POS = "thumbnail_seek_pos";
private static final String KEY_TRANSCODE_BLOCKS_MULTIPLE_CONNECTIONS = "transcode_block_multiple_connections";
+ private static final String KEY_TRANSCODE_FOLDER_NAME = "transcode_folder_name";
private static final String KEY_TRANSCODE_KEEP_FIRST_CONNECTION = "transcode_keep_first_connection";
private static final String KEY_TSMUXER_FORCEFPS = "tsmuxer_forcefps";
private static final String KEY_TSMUXER_PREREMIX_AC3 = "tsmuxer_preremix_ac3";
@@ -568,11 +569,12 @@ public int getProxyServerPort() {
*/
public String getLanguage() {
String def = Locale.getDefault().getLanguage();
+
if (def == null) {
def = "en";
}
- String value = getString(KEY_LANGUAGE, def);
- return StringUtils.isNotBlank(value) ? value.trim() : def;
+
+ return getNonBlankString(KEY_LANGUAGE, def);
}
/**
@@ -625,6 +627,27 @@ private String getString(String key, String def) {
}
return value;
}
+
+ /**
+ * Return the <code>String</code> value for a given configuration key if the
+ * value is non-blank (i.e. not null, not an empty string, not all whitespace).
+ * Otherwise return the supplied default value.
+ * The value is returned with leading and trailing whitespace removed in both cases.
+ * @param key The key to look up.
+ * @param def The default value to return when no valid key value can be found.
+ * @return The value configured for the key.
+ */
+ private String getNonBlankString(String key, String def) {
+ String value = configuration.getString(key);
+
+ if (StringUtils.isNotBlank(value)) {
+ return value.trim();
+ } else if (def != null) {
+ return def.trim();
+ } else {
+ return def;
+ }
+ }
/**
* Return a <code>List</code> of <code>String</code> values for a given configuration
@@ -2242,4 +2265,21 @@ public void removeConfigurationListener(ConfigurationListener l) {
public boolean initBufferMax() {
return getBoolean(KEY_BUFFER_MAX, false);
}
+
+ /**
+ * Retrieve the name of the folder used to select subtitles, audio channels, chapters, engines &amp;c.
+ * Defaults to the localized version of <pre>#--TRANSCODE--#</pre>.
+ * @return The folder name.
+ */
+ public String getTranscodeFolderName() {
+ return getNonBlankString(KEY_TRANSCODE_FOLDER_NAME, Messages.getString("TranscodeVirtualFolder.0"));
+ }
+
+ /**
+ * Set a custom name for the <pre>#--TRANSCODE--#</pre> folder.
+ * @param name The folder name.
+ */
+ public void setTranscodeFolderName(String name) {
+ configuration.setProperty(KEY_TRANSCODE_FOLDER_NAME, name);
+ }
}
@@ -70,28 +70,33 @@
protected static final int MAX_ARCHIVE_ENTRY_SIZE = 10000000;
protected static final int MAX_ARCHIVE_SIZE_SEEK = 800000000;
- protected static final String TRANSCODE_FOLDER = Messages.getString("DLNAResource.0"); // localized #--TRANSCODE--#
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated This field will be removed. Use {@link net.pms.configuration.PmsConfiguration#getTranscodeFolderName()} instead.
+ */
+ @Deprecated
+ protected static final String TRANSCODE_FOLDER = Messages.getString("TranscodeVirtualFolder.0"); // localized #--TRANSCODE--#
+
+ /**
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected int specificType;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected String id;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected DLNAResource parent;
/**
- * @deprecated This variable will be removed. Use {@link #getFormat()} and
+ * @deprecated This field will be removed. Use {@link #getFormat()} and
* {@link #setFormat(Format)} instead.
*/
@Deprecated
@@ -103,27 +108,27 @@
private Format format;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected DLNAMediaInfo media;
/**
* @deprecated Use {@link #getMediaAudio()} and {@link
- * #setMediaAudio(DLNAMediaAudio)} to access this variable.
+ * #setMediaAudio(DLNAMediaAudio)} to access this field.
*/
@Deprecated
protected DLNAMediaAudio media_audio;
/**
* @deprecated Use {@link #getMediaSubtitle()} and {@link
- * #setMediaSubtitle(DLNAMediaSubtitle)} to access this variable.
+ * #setMediaSubtitle(DLNAMediaSubtitle)} to access this field.
*/
@Deprecated
protected DLNAMediaSubtitle media_subtitle;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected long lastmodified;
@@ -135,33 +140,33 @@
private Player player;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected boolean discovered = false;
private ProcessWrapper externalProcess;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected boolean srtFile;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected int updateId = 1;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
public static int systemUpdateId = 1;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected boolean noName;
@@ -171,27 +176,27 @@
private DLNAResource second;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*
* The time range for the file containing the start and end time in seconds.
*/
@Deprecated
protected Range.Time splitRange = new Range.Time();
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected int splitTrack;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected String fakeParentId;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
// Ditlew - needs this in one of the derived classes
@Deprecated
@@ -200,13 +205,13 @@
private String dlnaspec;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected boolean avisynth;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*/
@Deprecated
protected boolean skipTranscode = false;
@@ -215,23 +220,23 @@
private String flags;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*
* List of children objects associated with this DLNAResource. This is only valid when the DLNAResource is of the container type.
*/
@Deprecated
protected List<DLNAResource> children;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*
* the id which the last child got, so the next child can get unique id with incrementing this value.
*/
@Deprecated
protected int lastChildrenId;
/**
- * @deprecated Use standard getter and setter to access this variable.
+ * @deprecated Use standard getter and setter to access this field.
*
* The last time when refresh is called.
*/
@@ -18,8 +18,10 @@
*/
package net.pms.dlna.virtual;
+import net.pms.PMS;
+
public class TranscodeVirtualFolder extends VirtualFolder {
public TranscodeVirtualFolder(String thumbnailIcon) {
- super(TRANSCODE_FOLDER, thumbnailIcon);
+ super(PMS.getConfiguration().getTranscodeFolderName(), thumbnailIcon);
}
}
@@ -3,7 +3,6 @@ DLNAMediaDatabase.1=A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
DLNAMediaDatabase.2=Cleanup database...
DLNAMediaDatabase.3=Compacting database...
DLNAMediaDatabase.4=Scanning Folder:
-DLNAResource.0=\#--TRANSCODE--\#
FFMpegDVRMSRemux.0=Alternative FFmpeg Path:
FFMpegDVRMSRemux.1=Settings for DVR-MS remuxing
FFMpegVideo.0=Encoder settings for AviSynth/FFmpeg engine only (Prefer AviSynth/MEncoder)
@@ -296,4 +295,5 @@ TrTab2.63=Good quality for HD Wifi transcoding
TrTab2.64=Medium quality for HD Wifi transcoding
TrTab2.65=Low quality, low-end CPU or HD Wifi transcoding
TracesTab.3=Clear
+TranscodeVirtualFolder.0=\#--TRANSCODE--\#
TreeNodeSettings.4=This engine is not loaded\!

0 comments on commit 86466da

Please sign in to comment.