// Catalog.GetString ("Video Library")
        public VideoLibrarySource() : base(Catalog.GetString("Videos"), "VideoLibrary", 50)
        {
            MediaTypes    = TrackMediaAttributes.VideoStream;
            NotMediaTypes = TrackMediaAttributes.Podcast;
            Properties.SetStringList("Icon.Name", "video-x-generic", "video", "source-library");
            Properties.Set <string> ("SearchEntryDescription", Catalog.GetString("Search your videos"));
            Properties.SetString("TrackView.ColumnControllerXml", String.Format(@"
                <column-controller>
                  <add-all-defaults />
                  <remove-default column=""DiscColumn"" />
                  <remove-default column=""AlbumColumn"" />
                  <remove-default column=""ComposerColumn"" />
                  <remove-default column=""AlbumArtistColumn"" />
                  <remove-default column=""ConductorColumn"" />
                  <remove-default column=""ComposerColumn"" />
                  <remove-default column=""BpmColumn"" />
                  <sort-column direction=""asc"">track_title</sort-column>
                  <column modify-default=""ArtistColumn"">
                    <title>{0}</title>
                    <long-title>{0}</long-title>
                  </column>
                </column-controller>
            ", Catalog.GetString("Produced By")));

            // Migrate the old import settings, if necessary
            if (DatabaseConfigurationClient.Client.Get <int> ("VideoImportSettingsMigrated", 0) != 1)
            {
                bool oldImportSettings = OldImportSetting.Get();
                CopyOnImport = oldImportSettings;
                DatabaseConfigurationClient.Client.Set <int> ("VideoImportSettingsMigrated", 1);
            }
        }
Пример #2
0
        // Catalog.GetString ("Music Library")
        public MusicLibrarySource() : base(SourceName, "Library", 40)
        {
            MediaTypes    = TrackMediaAttributes.Music | TrackMediaAttributes.AudioStream;
            NotMediaTypes = TrackMediaAttributes.Podcast | TrackMediaAttributes.VideoStream | TrackMediaAttributes.AudioBook;
            Properties.SetStringList("Icon.Name", "audio-x-generic", "source-library");

            Properties.Set <string> ("SearchEntryDescription", Catalog.GetString("Search your music"));

            // Migrate the old library-location schema, if necessary
            if (DatabaseConfigurationClient.Client.Get <int> ("MusicLibraryLocationMigrated", 0) != 1)
            {
                string old_location = OldLocationSchema.Get();
                if (!String.IsNullOrEmpty(old_location))
                {
                    BaseDirectory = old_location;
                }
                DatabaseConfigurationClient.Client.Set <int> ("MusicLibraryLocationMigrated", 1);
            }

            // Migrate the old import and rename settings, if necessary
            if (DatabaseConfigurationClient.Client.Get <int> ("MusicImportSettingsMigrated", 0) != 1)
            {
                bool oldImportSettings = OldImportSetting.Get();
                bool oldRenameSettings = OldRenameSetting.Get();
                CopyOnImport = oldImportSettings;
                MoveFiles    = oldRenameSettings;
                DatabaseConfigurationClient.Client.Set <int> ("MusicImportSettingsMigrated", 1);
            }

            SetFileNamePattern(MusicFileNamePattern);

            Section misc = PreferencesPage.Add(new Section("misc",
                                                           Catalog.GetString("Miscellaneous"), 10));

            misc.Add(new SchemaPreference <bool> (LibrarySchema.SortByAlbumYear,
                                                  Catalog.GetString("_Sort an artist's albums by year, not title"), null,
                                                  delegate {
                DatabaseTrackModel.Resort();
                DatabaseTrackModel.Reload();
            }
                                                  ));
        }