Skip to content

Commit

Permalink
AppDelegate: set grid by default for video models
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikanbu committed Oct 26, 2021
1 parent af10dbc commit 1d3272a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SharedSources/MediaLibraryModel/MediaGroupViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MediaGroupViewModel: MLBaseModel {
var files: [VLCMLMediaGroup]

var cellType: BaseCollectionViewCell.Type {
return UserDefaults.standard.bool(forKey: "\(kVLCAudioLibraryGridLayout)\(name)") ? MovieCollectionViewCell.self : MediaCollectionViewCell.self
return UserDefaults.standard.bool(forKey: "\(kVLCVideoLibraryGridLayout)") ? MovieCollectionViewCell.self : MediaCollectionViewCell.self
}

var medialibrary: MediaLibraryService
Expand Down
2 changes: 1 addition & 1 deletion SharedSources/MediaLibraryModel/VideoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class VideoModel: MediaModel {
var files = [VLCMLMedia]()

var cellType: BaseCollectionViewCell.Type {
return UserDefaults.standard.bool(forKey: "\(kVLCAudioLibraryGridLayout)\(secondName)") ? MovieCollectionViewCell.self : MediaCollectionViewCell.self
return UserDefaults.standard.bool(forKey: "\(kVLCVideoLibraryGridLayout)") ? MovieCollectionViewCell.self : MediaCollectionViewCell.self
}

var medialibrary: MediaLibraryService
Expand Down
3 changes: 2 additions & 1 deletion Sources/VLCAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ + (void)initialize
kVLCSettingLabNewPlayer : kVLCSettingLabNewPlayerDefaultValue,
@"kVLCAudioLibraryGridLayoutALBUMS" : @(YES),
@"kVLCAudioLibraryGridLayoutARTISTS" : @(YES),
@"kVLCAudioLibraryGridLayoutGENRES" : @(YES)
@"kVLCAudioLibraryGridLayoutGENRES" : @(YES),
kVLCVideoLibraryGridLayout : @(YES)
};
[defaults registerDefaults:appDefaults];
}
Expand Down
1 change: 1 addition & 0 deletions Sources/VLCConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#define kVLChttpScanSubtitle @"http-scan-subtitle"
#define kVLCHTTPUploadDirectory @"Upload"
#define kVLCAudioLibraryGridLayout @"kVLCAudioLibraryGridLayout"
#define kVLCVideoLibraryGridLayout @"kVLCVideoLibraryGridLayout"

#define kSupportedFileExtensions @"\\.(3g2|3gp|3gp2|3gpp|amv|asf|avi|bik|bin|crf|divx|drc|dv|evo|f4v|flv|gvi|gxf|hevc|iso|m1v|m2v|m2t|m2ts|m4v|mkv|mov|mp2|mp2v|mp4|mp4v|mpe|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv2|mts|mtv|mxf|mxg|nsv|nuv|ogg|ogm|ogv|ogx|ps|rec|rm|rmvb|rpl|thp|tod|ts|tts|txd|vlc|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedSubtitleFileExtensions @"\\.(cdg|idx|srt|sub|utf|ass|ssa|aqt|jss|psb|rt|smi|txt|smil|stl|usf|dks|pjs|mpl2|mks|vtt|ttml|dfxp)$"
Expand Down

0 comments on commit 1d3272a

Please sign in to comment.