/// <summary>
        /// Process and load a single osz2 package.
        /// </summary>
        private static bool ProcessPackage(string filename, BeatmapTreeLevel treeLevel)
        {
            MapPackage package = Osz2Factory.TryOpen(filename);

            if (package == null)
            {
                NotificationManager.ShowMessage("Error reading " + Path.GetFileName(filename), Color.Red, 4000);
                return(false);
            }

            int mapsLoaded = 0;

            foreach (string file in package.MapFiles)
            {
                Beatmap b = new Beatmap {
                    Filename = file
                };

                if (InitialLoadComplete)
                {
                    int index = Beatmaps.BinarySearch(b);

                    if (index >= 0)
                    {
                        Beatmap found = Beatmaps[index];

                        if (found.InOszContainer)
                        {
                            found.DatabaseNotFound         = false;
                            found.BeatmapPresent           = true;
                            found.ContainingFolderAbsolute = filename;
                            found.InOszContainer           = true;

                            treeLevel.Beatmaps.Add(found);
                            mapsLoaded++;
                            continue;
                        }
                    }
                }

                b.BeatmapSetId = Convert.ToInt32(package.GetMetadata(MapMetaType.BeatmapSetID));
                b.BeatmapId    = package.GetIDByMap(file);

                b.ContainingFolderAbsolute = filename;
                b.InOszContainer           = true;
                b.AudioPresent             = true;
                b.BeatmapPresent           = true;

                b.ProcessHeaders();
                if (!b.HeadersLoaded)
                {
                    //failed?
                    continue;
                }

                b.NewFile = true;
                NewFilesList.Add(b);

                if (!b.AudioPresent && !b.BeatmapPresent)
                {
                    continue;
                }

                Add(b);
                lastAddedMap = b;
                treeLevel.Beatmaps.Add(b);
                mapsLoaded++;
            }

            Osz2Factory.CloseMapPackage(package);
            //package.Unlock();

            return(mapsLoaded > 0);
        }