beedydeedy / videobrowser

Automatically exported from code.google.com/p/videobrowser
Other
1 stars 0 forks source link

Disc names not shown when using MyMovies.xml metadata #80

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a title in MyMovies with multiple discs (such as a box set)
2. View folder in Media Browser - you only get the box set name, not the
disc names.

What is the expected output? What do you see instead?

MyMovies title called "CSI Las Vegas: Season 5" containing discs "Disc 1 -
Episodes 01-04" and "Disc 2 - Episodes 05-08". I would expect to see
something along the lines of:
a) "Disc 1 - Episodes 01-04"
b) "Disc 1 - Episodes 01-04 (part of CSI Las Vegas: Season 5"
c) "CSI Las Vegas: Season 5 - Disc 1 - Episode 01-04"

Out of those, I would prefer (b) as it places the disc in context, but
shows you the disc title first.

At the moment, you get two folders under "CSI Las Vegas: Season 5" which
are both called "CSI Las Vegas: Season 5"!

What version of the product are you using? On what operating system?
Media Browser Beta 2.0.11 (R865)
Windows 7 Ultimate

Please provide any additional information below.
The data required is in the MyMovies.xml file. Sample code:

[Code]

// Helper method to safely get a string using an XPath query, 
// or return string.Empty
private string SafeGetString(XmlNode node, string path)
{
    XmlNode result = node.SelectSingleNode(path);
    if (result != null)
        return result.InnerText;
    return string.Empty;
}

[/Code]

In MovieProviderFromXml.cs around line 71:

[Code]
// Gets disc name for disc in current location if on side A
string discName = SafeGetString(doc,
"Title/Discs/Disc/Name[../LocationSideA='.']");

// Gets disc name for disc in current location if on side B
if (discName.Equals(string.Empty))
{
    discName = SafeGetString(doc,
"Title/Discs/Disc/Name[../LocationSideB='.']");
}
[/Code]

You can format the title however you want, like:

[Code]
// Format title based on whether there is a disc name or not
if (discName.Equals(string.Empty))
{
    store.Name = s;
}
else
{
    store.Name = string.format("{1} (part of {0})", s, discName);
}
[/Code]

For future use, you could do a sanity check to make sure that if there was
only 1 disc then you would not show "discName".

Peter.

Original issue reported on code.google.com by PJACl...@gmail.com on 15 Apr 2009 at 6:21