Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d44f82a
authored
Jun 23, 2021
by
samrobinson
Committed by
Oliver Woodman
Jun 30, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Correct naming of compilation field MediaMetadata.
PiperOrigin-RevId: 381016088
parent
7d05f204
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
library/common/src/main/java/com/google/android/exoplayer2/MediaMetadata.java
library/common/src/test/java/com/google/android/exoplayer2/MediaMetadataTest.java
library/common/src/main/java/com/google/android/exoplayer2/MediaMetadata.java
View file @
2d44f82a
...
@@ -66,7 +66,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -66,7 +66,7 @@ public final class MediaMetadata implements Bundleable {
@Nullable
private
Integer
discNumber
;
@Nullable
private
Integer
discNumber
;
@Nullable
private
Integer
totalDiscCount
;
@Nullable
private
Integer
totalDiscCount
;
@Nullable
private
CharSequence
genre
;
@Nullable
private
CharSequence
genre
;
@Nullable
private
CharSequence
playlistTitle
;
@Nullable
private
CharSequence
compilation
;
@Nullable
private
Bundle
extras
;
@Nullable
private
Bundle
extras
;
public
Builder
()
{}
public
Builder
()
{}
...
@@ -100,7 +100,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -100,7 +100,7 @@ public final class MediaMetadata implements Bundleable {
this
.
discNumber
=
mediaMetadata
.
discNumber
;
this
.
discNumber
=
mediaMetadata
.
discNumber
;
this
.
totalDiscCount
=
mediaMetadata
.
totalDiscCount
;
this
.
totalDiscCount
=
mediaMetadata
.
totalDiscCount
;
this
.
genre
=
mediaMetadata
.
genre
;
this
.
genre
=
mediaMetadata
.
genre
;
this
.
playlistTitle
=
mediaMetadata
.
playlistTitle
;
this
.
compilation
=
mediaMetadata
.
compilation
;
this
.
extras
=
mediaMetadata
.
extras
;
this
.
extras
=
mediaMetadata
.
extras
;
}
}
...
@@ -299,9 +299,9 @@ public final class MediaMetadata implements Bundleable {
...
@@ -299,9 +299,9 @@ public final class MediaMetadata implements Bundleable {
return
this
;
return
this
;
}
}
/** Sets the
playlist title
. */
/** Sets the
compilation
. */
public
Builder
set
PlaylistTitle
(
@Nullable
CharSequence
playlistTitle
)
{
public
Builder
set
Compilation
(
@Nullable
CharSequence
compilation
)
{
this
.
playlistTitle
=
playlistTitle
;
this
.
compilation
=
compilation
;
return
this
;
return
this
;
}
}
...
@@ -475,8 +475,8 @@ public final class MediaMetadata implements Bundleable {
...
@@ -475,8 +475,8 @@ public final class MediaMetadata implements Bundleable {
@Nullable
public
final
Integer
totalDiscCount
;
@Nullable
public
final
Integer
totalDiscCount
;
/** Optional genre. */
/** Optional genre. */
@Nullable
public
final
CharSequence
genre
;
@Nullable
public
final
CharSequence
genre
;
/** Optional
playlist title
. */
/** Optional
compilation
. */
@Nullable
public
final
CharSequence
playlistTitle
;
@Nullable
public
final
CharSequence
compilation
;
/**
/**
* Optional extras {@link Bundle}.
* Optional extras {@link Bundle}.
...
@@ -516,7 +516,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -516,7 +516,7 @@ public final class MediaMetadata implements Bundleable {
this
.
discNumber
=
builder
.
discNumber
;
this
.
discNumber
=
builder
.
discNumber
;
this
.
totalDiscCount
=
builder
.
totalDiscCount
;
this
.
totalDiscCount
=
builder
.
totalDiscCount
;
this
.
genre
=
builder
.
genre
;
this
.
genre
=
builder
.
genre
;
this
.
playlistTitle
=
builder
.
playlistTitle
;
this
.
compilation
=
builder
.
compilation
;
this
.
extras
=
builder
.
extras
;
this
.
extras
=
builder
.
extras
;
}
}
...
@@ -562,7 +562,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -562,7 +562,7 @@ public final class MediaMetadata implements Bundleable {
&&
Util
.
areEqual
(
discNumber
,
that
.
discNumber
)
&&
Util
.
areEqual
(
discNumber
,
that
.
discNumber
)
&&
Util
.
areEqual
(
totalDiscCount
,
that
.
totalDiscCount
)
&&
Util
.
areEqual
(
totalDiscCount
,
that
.
totalDiscCount
)
&&
Util
.
areEqual
(
genre
,
that
.
genre
)
&&
Util
.
areEqual
(
genre
,
that
.
genre
)
&&
Util
.
areEqual
(
playlistTitle
,
that
.
playlistTitle
);
&&
Util
.
areEqual
(
compilation
,
that
.
compilation
);
}
}
@Override
@Override
...
@@ -596,7 +596,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -596,7 +596,7 @@ public final class MediaMetadata implements Bundleable {
discNumber
,
discNumber
,
totalDiscCount
,
totalDiscCount
,
genre
,
genre
,
playlistTitle
);
compilation
);
}
}
// Bundleable implementation.
// Bundleable implementation.
...
@@ -632,7 +632,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -632,7 +632,7 @@ public final class MediaMetadata implements Bundleable {
FIELD_DISC_NUMBER
,
FIELD_DISC_NUMBER
,
FIELD_TOTAL_DISC_COUNT
,
FIELD_TOTAL_DISC_COUNT
,
FIELD_GENRE
,
FIELD_GENRE
,
FIELD_
PLAYLIST_TITLE
,
FIELD_
COMPILATION
,
FIELD_EXTRAS
FIELD_EXTRAS
})
})
private
@interface
FieldNumber
{}
private
@interface
FieldNumber
{}
...
@@ -665,7 +665,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -665,7 +665,7 @@ public final class MediaMetadata implements Bundleable {
private
static
final
int
FIELD_DISC_NUMBER
=
25
;
private
static
final
int
FIELD_DISC_NUMBER
=
25
;
private
static
final
int
FIELD_TOTAL_DISC_COUNT
=
26
;
private
static
final
int
FIELD_TOTAL_DISC_COUNT
=
26
;
private
static
final
int
FIELD_GENRE
=
27
;
private
static
final
int
FIELD_GENRE
=
27
;
private
static
final
int
FIELD_
PLAYLIST_TITLE
=
28
;
private
static
final
int
FIELD_
COMPILATION
=
28
;
private
static
final
int
FIELD_EXTRAS
=
1000
;
private
static
final
int
FIELD_EXTRAS
=
1000
;
@Override
@Override
...
@@ -685,7 +685,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -685,7 +685,7 @@ public final class MediaMetadata implements Bundleable {
bundle
.
putCharSequence
(
keyForField
(
FIELD_COMPOSER
),
composer
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_COMPOSER
),
composer
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_CONDUCTOR
),
conductor
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_CONDUCTOR
),
conductor
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_GENRE
),
genre
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_GENRE
),
genre
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_
PLAYLIST_TITLE
),
playlistTitle
);
bundle
.
putCharSequence
(
keyForField
(
FIELD_
COMPILATION
),
compilation
);
if
(
userRating
!=
null
)
{
if
(
userRating
!=
null
)
{
bundle
.
putBundle
(
keyForField
(
FIELD_USER_RATING
),
userRating
.
toBundle
());
bundle
.
putBundle
(
keyForField
(
FIELD_USER_RATING
),
userRating
.
toBundle
());
...
@@ -755,7 +755,7 @@ public final class MediaMetadata implements Bundleable {
...
@@ -755,7 +755,7 @@ public final class MediaMetadata implements Bundleable {
.
setComposer
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_COMPOSER
)))
.
setComposer
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_COMPOSER
)))
.
setConductor
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_CONDUCTOR
)))
.
setConductor
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_CONDUCTOR
)))
.
setGenre
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_GENRE
)))
.
setGenre
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_GENRE
)))
.
set
PlaylistTitle
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_PLAYLIST_TITLE
)))
.
set
Compilation
(
bundle
.
getCharSequence
(
keyForField
(
FIELD_COMPILATION
)))
.
setExtras
(
bundle
.
getBundle
(
keyForField
(
FIELD_EXTRAS
)));
.
setExtras
(
bundle
.
getBundle
(
keyForField
(
FIELD_EXTRAS
)));
if
(
bundle
.
containsKey
(
keyForField
(
FIELD_USER_RATING
)))
{
if
(
bundle
.
containsKey
(
keyForField
(
FIELD_USER_RATING
)))
{
...
...
library/common/src/test/java/com/google/android/exoplayer2/MediaMetadataTest.java
View file @
2d44f82a
...
@@ -66,7 +66,7 @@ public class MediaMetadataTest {
...
@@ -66,7 +66,7 @@ public class MediaMetadataTest {
assertThat
(
mediaMetadata
.
discNumber
).
isNull
();
assertThat
(
mediaMetadata
.
discNumber
).
isNull
();
assertThat
(
mediaMetadata
.
totalDiscCount
).
isNull
();
assertThat
(
mediaMetadata
.
totalDiscCount
).
isNull
();
assertThat
(
mediaMetadata
.
genre
).
isNull
();
assertThat
(
mediaMetadata
.
genre
).
isNull
();
assertThat
(
mediaMetadata
.
playlistTitle
).
isNull
();
assertThat
(
mediaMetadata
.
compilation
).
isNull
();
assertThat
(
mediaMetadata
.
extras
).
isNull
();
assertThat
(
mediaMetadata
.
extras
).
isNull
();
}
}
...
@@ -124,7 +124,7 @@ public class MediaMetadataTest {
...
@@ -124,7 +124,7 @@ public class MediaMetadataTest {
.
setDiscNumber
(
1
)
.
setDiscNumber
(
1
)
.
setTotalDiscCount
(
3
)
.
setTotalDiscCount
(
3
)
.
setGenre
(
"Pop"
)
.
setGenre
(
"Pop"
)
.
set
PlaylistTitle
(
"Amazing songs."
)
.
set
Compilation
(
"Amazing songs."
)
.
setExtras
(
extras
)
// Extras is not implemented in MediaMetadata.equals(Object o).
.
setExtras
(
extras
)
// Extras is not implemented in MediaMetadata.equals(Object o).
.
build
();
.
build
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment