.iso and .img is not added (in IMDBFetcher.cs) when scanning movie db from conf (1 Viewer)

Craydk

Portal Member
June 4, 2007
31
1
Home Country
Denmark Denmark
When scanning movie folders to movie db .iso and .img are not properly added to the list.
it can be fixed VERY crude by adding :
if (item.Path.ToLower().IndexOf(".iso") >= 0)
availableFiles.Add(item.Path);
if (item.Path.ToLower().IndexOf(".img") >= 0)
availableFiles.Add(item.Path);
to
private static void CountFiles(string path, ref ArrayList availableFiles) in IMDBFetcher.cs but that is far from pretty.

and if it could refrain from mounting in deamon tools (takes forever) it would be nice to.

The changed method looks like this.

private static void CountFiles(string path, ref ArrayList availableFiles)
{
//
// Count the files in the current directory
// and add them to the list of availble files
//
try
{
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(MediaPortal.Util.Utils.VideoExtensions);
ArrayList items = dir.GetDirectoryUnProtected(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
if (item.Label != "..")
{
if (item.Path.ToLower().IndexOf("video_ts") >= 0)
{
string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
availableFiles.Add(strFile);
//System.Windows.Forms.MessageBox.Show(strFile);
}
else
{
if (item.Path.ToLower().IndexOf(".iso") >= 0)
availableFiles.Add(item.Path);
if (item.Path.ToLower().IndexOf(".img") >= 0)
availableFiles.Add(item.Path);

//System.Windows.Forms.MessageBox.Show(item.Path);
CountFiles(item.Path, ref availableFiles);
}
}
}
else
{
availableFiles.Add(item.Path);
// System.Windows.Forms.MessageBox.Show(item.Path);
}
}
}
catch (Exception e)
{
Log.Info("Exception counting files:{0}", e);
// Ignore
}
}
 

piranha

MP Donator
  • Premium Supporter
  • September 17, 2005
    370
    10
    Shouldn't MediaPortal.Util.Utils.VideoExte nsions contain .iso and .img if you add them to video extension list?
     

    Craydk

    Portal Member
    June 4, 2007
    31
    1
    Home Country
    Denmark Denmark
    they get added to the "ArrayList items". but "availableFiles.Add(item.Path);" never gets called with these files.

    i think that it is the "item.IsFolder" property perhaps which are on for images? havent checked though..

    it works when i add the lines above, but not without...
     

    Johan

    Portal Pro
    April 19, 2006
    443
    11
    48
    Home Country
    Sweden Sweden
    I have asked about this earlier but have not really got any response. When I do IMDB search from within MP it mounts them with daemon tools and searches IMDB for the DISC name which is not a good solution sicne this in most cases does not result in anything. I would prefer if the IMDB scanner could treat them as a normal video file like .avi files.
     

    Craydk

    Portal Member
    June 4, 2007
    31
    1
    Home Country
    Denmark Denmark
    i dont think that it actually searches IMDB for the disc names, because they dont get added to availableFiles.Add(item.Path);

    u can add them manually by doing

    if (item.Path.ToLower().IndexOf(".iso") >= 0)
    availableFiles.Add(item.Path);
    if (item.Path.ToLower().IndexOf(".img") >= 0)
    availableFiles.Add(item.Path);

    but a more dynamic method would be better.
     

    Johan

    Portal Pro
    April 19, 2006
    443
    11
    48
    Home Country
    Sweden Sweden
    Ehm... are we talking C? Compiling yourself? Hehe no luck for me then. I am no programmer.
     

    Johan

    Portal Pro
    April 19, 2006
    443
    11
    48
    Home Country
    Sweden Sweden
    Ahh! How great! I will try this!
    The same problem is however within MP when I scan IMDB from within Movie section in MP.
    Is this something that is easy to fix?
     

    Users who are viewing this thread

    Top Bottom