Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f679ba7d authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Cherrypick from GB. Do Not Merge.

Send "compilation" tag when inserting into the database.
It's not actually inserted into the database, but the media provider uses it
for disambiguating albums.
b/3311831

Change-Id: I67deb044800a6cb626c69bf3d54d51df4bf830f2
parent 6b3dc7a2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -400,6 +400,7 @@ public class MediaScanner
        private long mLastModified;
        private long mFileSize;
        private String mWriter;
        private int mCompilation;

        public FileCacheEntry beginFile(String path, String mimeType, long lastModified,
                long fileSize, boolean isDirectory) {
@@ -509,6 +510,7 @@ public class MediaScanner
            mPath = path;
            mLastModified = lastModified;
            mWriter = null;
            mCompilation = 0;

            return entry;
        }
@@ -620,6 +622,8 @@ public class MediaScanner
                mDuration = parseSubstring(value, 0, 0);
            } else if (name.equalsIgnoreCase("writer") || name.startsWith("writer;")) {
                mWriter = value.trim();
            } else if (name.equalsIgnoreCase("compilation")) {
                mCompilation = parseSubstring(value, 0, 0);
            }
        }

@@ -670,6 +674,7 @@ public class MediaScanner
                }
                map.put(Audio.Media.TRACK, mTrack);
                map.put(Audio.Media.DURATION, mDuration);
                map.put(Audio.Media.COMPILATION, mCompilation);
            }
            return map;
        }