video_folders = d:\\media\\Media
audio_folders = d:\\media\\Music
image_folders = d:\\media\\PicturesIndex: net/pms/dlna/DLNAResource.java
===================================================================
--- net/pms/dlna/DLNAResource.java (wersja 496)
+++ net/pms/dlna/DLNAResource.java (kopia robocza)
@@ -111,6 +111,7 @@
this.parent = parent;
}
protected Format ext;
+ protected String MediaClass;
public DLNAMediaInfo media;
public DLNAMediaAudio media_audio;
public DLNAMediaSubtitle media_subtitle;
@@ -235,7 +236,12 @@
* @param child DLNAResource to add to a container type.
*/
- public void addChild(DLNAResource child) {
+ public void addChild(DLNAResource child){
+ addChild(child, null);
+ }
+
+
+ public void addChild(DLNAResource child, String childFormat) {
//child.expert = expert;
child.parent = this;
if (parent != null)
@@ -248,6 +254,8 @@
if (allChildrenAreFolders && !child.isFolder())
allChildrenAreFolders = false;
+ child.MediaClass = childFormat;
+
children.add(child);
childrenNumber++;
@@ -984,7 +992,7 @@
}
String thumbURL = getThumbnailURL();
- if (!isFolder() && (ext == null || (ext != null && thumbURL != null))) {
+ if (!isFolder() && (ext == null || (ext != null && thumbURL != null)) && PMS.getConfiguration().getThumbnailsEnabled()) {
openTag(sb, "upnp:albumArtURI");
addAttribute(sb, "xmlns:dlna", "urn:schemas-dlna-org:metadata-1-0/");
if (getThumbnailContentType().equals(PNG_TYPEMIME) && !mediaRenderer.isBRAVIA())
@@ -996,7 +1004,7 @@
closeTag(sb, "upnp:albumArtURI");
}
- if ((isFolder() || mediaRenderer.isBRAVIA()) && thumbURL != null){
+ if ((isFolder() || mediaRenderer.isBRAVIA()) && thumbURL != null && PMS.getConfiguration().getThumbnailsEnabled()){
openTag(sb, "res");
if (getThumbnailContentType().equals(PNG_TYPEMIME) && !mediaRenderer.isBRAVIA())
addAttribute(sb, "protocolInfo", "http-get:*:image/png:DLNA.ORG_PN=PNG_TN");
@@ -1039,8 +1047,29 @@
if (uclass != null)
addXMLTagAndAttribute(sb, "upnp:class", uclass);
- if (isFolder())
+ if (isFolder()) {
+ if(MediaClass == "V") {
+ openTag(sb, "av:mediaClass");
+ addAttribute(sb, "xmlns:av", "urn:schemas-sony-com:av");
+ endTag(sb);
+ sb.append("V");
+ closeTag(sb, "av:mediaClass");
+ } else if(MediaClass == "A") {
+ openTag(sb, "av:mediaClass");
+ addAttribute(sb, "xmlns:av", "urn:schemas-sony-com:av");
+ endTag(sb);
+ sb.append("M");
+ closeTag(sb, "av:mediaClass");
+ } else if(MediaClass == "I") {
+ openTag(sb, "av:mediaClass");
+ addAttribute(sb, "xmlns:av", "urn:schemas-sony-com:av");
+ endTag(sb);
+ sb.append("P");
+ closeTag(sb, "av:mediaClass");
+ }
+
closeTag(sb, "container");
+ }
else
closeTag(sb, "item");
Index: net/pms/PMS.java
===================================================================
--- net/pms/PMS.java (wersja 496)
+++ net/pms/PMS.java (kopia robocza)
@@ -592,6 +592,9 @@
File files [] = loadFoldersConf(configuration.getFolders());
if (files == null || files.length == 0)
files = File.listRoots();
+ File Audiofiles [] = loadFoldersConf(configuration.getAudioFolders());
+ File Videofiles [] = loadFoldersConf(configuration.getVideoFolders());
+ File Imagefiles [] = loadFoldersConf(configuration.getImageFolders());
/*
* initialize == false: make sure renderer.getRootFolder() doesn't call back into this method
* if it creates a new root folder
@@ -602,6 +605,9 @@
RootFolder rootFolder = getRootFolder(renderer, false);
rootFolder.browse(files);
+ rootFolder.browse(Videofiles, "V");
+ rootFolder.browse(Audiofiles, "A");
+ rootFolder.browse(Imagefiles, "I");
rootFolder.browse(MapFileConfiguration.parse(configuration.getVirtualFolders()));
String strAppData = System.getenv("APPDATA");
Index: net/pms/dlna/RootFolder.java
===================================================================
--- net/pms/dlna/RootFolder.java (wersja 496)
+++ net/pms/dlna/RootFolder.java (kopia robocza)
@@ -45,8 +45,12 @@
}
public void browse(File startFolders []) {
+ browse(startFolders, null);
+ }
+
+ public void browse(File startFolders [], String rootFormat) {
for(File f:startFolders) {
- addChild(new RealFile(f));
+ addChild(new RealFile(f), rootFormat);
}
}
Index: net/pms/configuration/PmsConfiguration.java
===================================================================
--- net/pms/configuration/PmsConfiguration.java (wersja 496)
+++ net/pms/configuration/PmsConfiguration.java (kopia robocza)
@@ -147,7 +147,10 @@
private static final String CONFIGURATION_PATH_MAC = System.getProperty("user.home") + "/Library/Application Support/PS3 Media Server/";
private static final char LIST_SEPARATOR = ',';
private static final String KEY_FOLDERS = "folders";
-
+ private static final String KEY_VIDEO_FOLDERS = "video_folders";
+ private static final String KEY_AUDIO_FOLDERS = "audio_folders";
+ private static final String KEY_IMAGE_FOLDERS = "image_folders";
+
private final PropertiesConfiguration configuration;
private final TempFolder tempFolder;
private final ProgramPathDisabler programPaths;
@@ -853,6 +856,30 @@
configuration.setProperty(KEY_FOLDERS, value);
}
+ public String getVideoFolders() {
+ return getString(KEY_VIDEO_FOLDERS, "");
+ }
+
+ public void setVideoFolders(String value) {
+ configuration.setProperty(KEY_VIDEO_FOLDERS, value);
+ }
+
+ public String getAudioFolders() {
+ return getString(KEY_AUDIO_FOLDERS, "");
+ }
+
+ public void setAudioFolders(String value) {
+ configuration.setProperty(KEY_AUDIO_FOLDERS, value);
+ }
+
+ public String getImageFolders() {
+ return getString(KEY_IMAGE_FOLDERS, "");
+ }
+
+ public void setImageFolders(String value) {
+ configuration.setProperty(KEY_IMAGE_FOLDERS, value);
+ }
+
public String getNetworkInterface() {
return getString(KEY_NETWORK_INTERFACE, "");
}
grolschie wrote:The patch doesn't work for the BDP-S370. I see all the folders on each XMB menu. Maybe this renderer is a bit different in how it communicates.
grolschie wrote:I am sure that my Sony BDP-S370 showed category specific items using WMP on XP.
<manufacturer>Microsoft</manufacturer>
<modelName>Windows Media Player Sharing</modelName>
<modelNumber>3.0</modelNumber>
...
<service>
<serviceType>urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1</serviceType>
<serviceId>urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar</serviceId>
<controlURL>/upnp/mrr/control</controlURL>
<eventSubURL>/upnp/mrr/eventsub</eventSubURL>
<SCPDURL>/upnp/mrr/scpd</SCPDURL>
</service>
</serviceList>Users browsing this forum: No registered users and 4 guests