Commit f8a81e7a authored by Felix Paul Kühne's avatar Felix Paul Kühne

library view on pad: leverage MLKit to show a show episode's show name within...

library view on pad: leverage MLKit to show a show episode's show name within the thumbnail and just the episode name as item name; same for audio-only media if artist and album name are known

Screenshot here: http://cl.ly/image/3A051P3a403h
parent 1010312a
......@@ -20,6 +20,9 @@
@property (nonatomic, strong) IBOutlet VLCLinearProgressIndicator *progressView;
@property (nonatomic, strong) IBOutlet UIButton *removeMediaButton;
@property (nonatomic, strong) IBOutlet UIImageView *mediaIsUnreadView;
@property (nonatomic, strong) IBOutlet UILabel *seriesNameLabel;
@property (nonatomic, strong) IBOutlet UILabel *artistNameLabel;
@property (nonatomic, strong) IBOutlet UILabel *albumNameLabel;
// Temporary workaround: until better solution
@property (nonatomic, weak) AQGridView *gridView;
......
......@@ -30,6 +30,7 @@
_contentView = self;
self.backgroundColor = [UIColor clearColor];
self.reuseIdentifier = @"AQPlaylistCell";
self.albumNameLabel.text = self.artistNameLabel.text = self.seriesNameLabel.text = @"";
}
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
......@@ -81,7 +82,18 @@
{
MLFile *mediaObject = self.mediaObject;
self.titleLabel.text = mediaObject.title;
self.albumNameLabel.text = self.artistNameLabel.text = self.seriesNameLabel.text = @"";
if ([mediaObject isAlbumTrack]) {
self.artistNameLabel.text = mediaObject.albumTrack.artist;
self.albumNameLabel.text = mediaObject.albumTrack.album.name;
self.titleLabel.text = (mediaObject.albumTrack.title.length > 0) ? mediaObject.albumTrack.title : mediaObject.title;
} else if ([mediaObject isShowEpisode]) {
self.seriesNameLabel.text = mediaObject.showEpisode.show.name;
self.titleLabel.text = (mediaObject.showEpisode.name.length > 0) ? mediaObject.showEpisode.name : mediaObject.title;
} else
self.titleLabel.text = mediaObject.title;
if (self.isEditing)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[mediaObject duration]], (int)([mediaObject fileSizeInBytes] / 1e6)];
else {
......
......@@ -37,32 +37,89 @@
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="978623485">
<object class="IBUILabel" id="438689809">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{21, 14}, {256, 144}}</string>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{19, 76}, {257, 20}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="986363358"/>
<reference key="NSNextKeyView" ref="42884626"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">1</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Artist Name</string>
<object class="NSColor" key="IBUITextColor" id="235416669">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<object class="NSColor" key="IBUIShadowColor" id="398609642">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">12</float>
<bool key="IBUIAdjustsLetterSpacingToFitWidth">YES</bool>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="363114361">
<int key="type">1</int>
<double key="pointSize">18</double>
</object>
<object class="NSFont" key="IBUIFont" id="859651538">
<string key="NSName">Helvetica</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIImageView" id="528008643">
<object class="IBUILabel" id="42884626">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{16, 9}, {266, 154}}</string>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 96}, {258, 28}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="978623485"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">thumbOverlay.png</string>
<string key="IBUIText">Album Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43MgA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<reference key="IBUIShadowColor" ref="398609642"/>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">10</float>
<bool key="IBUIAdjustsLetterSpacingToFitWidth">YES</bool>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="312922552">
<int key="type">1</int>
<double key="pointSize">14</double>
</object>
<object class="NSFont" key="IBUIFont" id="770724183">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIImageView" id="978623485">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{21, 14}, {256, 144}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="593524440"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUILabel" id="276503826">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">264</int>
......@@ -77,29 +134,15 @@
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Label</string>
<object class="NSColor" key="IBUITextColor" id="235416669">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="IBUITextColor" ref="235416669"/>
<nil key="IBUIHighlightedColor"/>
<object class="NSColor" key="IBUIShadowColor" id="398609642">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<reference key="IBUIShadowColor" ref="398609642"/>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">9</float>
<bool key="IBUIAdjustsLetterSpacingToFitWidth">YES</bool>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">18</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
<reference key="IBUIFontDescription" ref="363114361"/>
<reference key="IBUIFont" ref="859651538"/>
</object>
<object class="IBUILabel" id="610797449">
<reference key="NSNextResponder" ref="93090196"/>
......@@ -107,7 +150,6 @@
<string key="NSFrame">{{20, 190}, {258, 28}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="593524440"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
......@@ -123,16 +165,65 @@
<reference key="IBUIShadowColor" ref="398609642"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">14</double>
<reference key="IBUIFontDescription" ref="312922552"/>
<reference key="IBUIFont" ref="770724183"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="908380637">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{27, 12}, {230, 28}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="986363358"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Series Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43MgA</bytes>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
<nil key="IBUIHighlightedColor"/>
<reference key="IBUIShadowColor" ref="398609642"/>
<string key="IBUIShadowOffset">{0, 1}</string>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">9</float>
<bool key="IBUIAdjustsLetterSpacingToFitWidth">YES</bool>
<reference key="IBUIFontDescription" ref="312922552"/>
<reference key="IBUIFont" ref="770724183"/>
</object>
<object class="IBUIView" id="593524440">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{21, 146}, {256, 12}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="276503826"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIImageView" id="528008643">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{16, 9}, {266, 154}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="908380637"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">thumbOverlay.png</string>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUIButton" id="296556150">
<reference key="NSNextResponder" ref="93090196"/>
......@@ -140,7 +231,7 @@
<string key="NSFrame">{{260, 2}, {33, 29}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="276503826"/>
<reference key="NSNextKeyView" ref="438689809"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
......@@ -184,19 +275,6 @@
<string key="NSResourceName">badgeUnread~ipad.png</string>
</object>
</object>
<object class="IBUIView" id="593524440">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{21, 146}, {256, 12}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<string key="NSFrameSize">{298, 220}</string>
<reference key="NSSuperview"/>
......@@ -264,6 +342,30 @@
</object>
<int key="connectionID">27</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">albumNameLabel</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="42884626"/>
</object>
<int key="connectionID">31</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">artistNameLabel</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="438689809"/>
</object>
<int key="connectionID">32</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">seriesNameLabel</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="908380637"/>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">removeMedia:</string>
......@@ -304,6 +406,9 @@
<reference ref="986363358"/>
<reference ref="528008643"/>
<reference ref="593524440"/>
<reference ref="908380637"/>
<reference ref="438689809"/>
<reference ref="42884626"/>
</array>
<reference key="parent" ref="0"/>
</object>
......@@ -343,6 +448,21 @@
<reference key="object" ref="593524440"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">28</int>
<reference key="object" ref="908380637"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="438689809"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">30</int>
<reference key="object" ref="42884626"/>
<reference key="parent" ref="93090196"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
......@@ -356,15 +476,18 @@
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="26.CustomClassName">VLCLinearProgressIndicator</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">VLCPlaylistGridView</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="30.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">27</int>
<int key="maxID">33</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -399,14 +522,25 @@
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="albumNameLabel">UILabel</string>
<string key="artistNameLabel">UILabel</string>
<string key="mediaIsUnreadView">UIImageView</string>
<string key="progressView">VLCLinearProgressIndicator</string>
<string key="removeMediaButton">UIButton</string>
<string key="seriesNameLabel">UILabel</string>
<string key="subtitleLabel">UILabel</string>
<string key="thumbnailView">UIImageView</string>
<string key="titleLabel">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="albumNameLabel">
<string key="name">albumNameLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="artistNameLabel">
<string key="name">artistNameLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="mediaIsUnreadView">
<string key="name">mediaIsUnreadView</string>
<string key="candidateClassName">UIImageView</string>
......@@ -419,6 +553,10 @@
<string key="name">removeMediaButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="seriesNameLabel">
<string key="name">seriesNameLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="subtitleLabel">
<string key="name">subtitleLabel</string>
<string key="candidateClassName">UILabel</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment