Commit 0f0a005d authored by Geoffrey Métais's avatar Geoffrey Métais

Set unknown artist/album at media creation time

Do not parse all dataset to replace title and description for every
update anymore
parent bb7983f4
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">مؤدّ غير معروف</string>
<string name="unknown_album">مجموعة غير معروفة</string>
<string name="unknown_genre">أسلوب غير معروف</string>
<string name="various_artists">فنانون متعددون</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista desconocíu</string>
<string name="unknown_album">Álbum desconocíu</string>
<string name="unknown_genre">Xéneru desconocíu</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Невядомы артыст</string>
<string name="unknown_album">Невядомы альбом</string>
<string name="unknown_genre">Невядомы жанр</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">অজানা শিল্পী</string>
<string name="unknown_album">অজানা অ্যালবাম</string>
<string name="unknown_genre">অজানা ধরণ</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Nepoznat Izvođač</string>
<string name="unknown_album">Nepoznat Album</string>
<string name="unknown_genre">Nepoznat Žanr</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista desconegut</string>
<string name="unknown_album">Àlbum desconegut</string>
<string name="unknown_genre">Gènere desconegut</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista Scunnisciutu</string>
<string name="unknown_album">Albumu Scunnisciutu</string>
<string name="unknown_genre">Generu Scunnisciutu</string>
<string name="various_artists">Artisti Diversi</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Neznámý umělec</string>
<string name="unknown_album">Neznámé album</string>
<string name="unknown_genre">Neznámý žánr</string>
<string name="various_artists">Různí umělci</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artist Anhysbys</string>
<string name="unknown_album">Albwm Anhysbys</string>
<string name="unknown_genre">Genre Anhysbys</string>
<string name="various_artists">Artistiaid Amryw</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Ukendt kunstner</string>
<string name="unknown_album">Ukendt album</string>
<string name="unknown_genre">Ukendt genre</string>
<string name="various_artists">Diverse kunstnere</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Unbekannter Künstler</string>
<string name="unknown_album">Unbekanntes Album</string>
<string name="unknown_genre">Unbekanntes Genre</string>
<string name="various_artists">Verschiedene Künstler</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Άγνωστος καλλιτέχνης</string>
<string name="unknown_album">Άγνωστο Άλμπουμ</string>
<string name="unknown_genre">Άγνωστο Γένος</string>
<string name="various_artists">Διάφοροι καλλιτέχνες</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Unknown Artist</string>
<string name="unknown_album">Unknown Album</string>
<string name="unknown_genre">Unknown Genre</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista desconocido</string>
<string name="unknown_album">Álbum desconocido</string>
<string name="unknown_genre">Género desconocido</string>
<string name="various_artists">Varios artistas</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista desconocido</string>
<string name="unknown_album">Álbum desconocido</string>
<string name="unknown_genre">Género desconocido</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Tundmatu esitaja</string>
<string name="unknown_album">Tundmatu album</string>
<string name="unknown_genre">Tundmatu stiil</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista ezezaguna</string>
<string name="unknown_album">Album ezezaguna</string>
<string name="unknown_genre">Genero ezezaguna</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">خواننده ناشناس</string>
<string name="unknown_album">آلبوم ناشناس</string>
<string name="unknown_genre">ژانر ناشناس</string>
<string name="various_artists">هنرمندان مختلف</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Tuntematon esittäjä</string>
<string name="unknown_album">Tuntematon albumi</string>
<string name="unknown_genre">Tuntematon genre</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Ókent listafólk</string>
<string name="unknown_album">Ókend útgáva</string>
<string name="unknown_genre">Ókend sjangra</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artiste inconnu</string>
<string name="unknown_album">Album inconnu</string>
<string name="unknown_genre">Genre inconnu</string>
<string name="various_artists">Artistes Divers</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Unbekende artyst</string>
<string name="unknown_album">Unbekend album</string>
<string name="unknown_genre">Unbekend sjenre</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Neach-ealain neo-aithnichte</string>
<string name="unknown_album">Albam neo-aithnichte</string>
<string name="unknown_genre">Gnè neo-aithnichte</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista descoñecido</string>
<string name="unknown_album">Álbum descoñecido</string>
<string name="unknown_genre">Xénero descoñecido</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">અજ્ઞાત આર્ટિસ્ટ</string>
<string name="unknown_album">અજ્ઞાત આલ્બમ</string>
<string name="unknown_genre">અજ્ઞાત શૈલી</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">אמן בלתי ידוע</string>
<string name="unknown_album">אלבום בלתי ידוע</string>
<string name="unknown_genre">סגנון בלתי ידוע</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">अज्ञात कलाकार</string>
<string name="unknown_album">अज्ञात एल्बम</string>
<string name="unknown_genre">अज्ञात शैली</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Nepoznati izvođač</string>
<string name="unknown_album">Nepoznati album</string>
<string name="unknown_genre">Nepoznati žanr</string>
<string name="various_artists">Različiti izvođači</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Ismeretlen előadó</string>
<string name="unknown_album">Ismeretlen album</string>
<string name="unknown_genre">Ismeretlen műfaj</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artis Tidak Dikenal</string>
<string name="unknown_album">Album Tidak Dikenal</string>
<string name="unknown_genre">Jenis Musik Tidak Dikenal</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Óþekktur flytjandi</string>
<string name="unknown_album">Óþekkt albúm</string>
<string name="unknown_genre">Óþekkt tegund</string>
<string name="various_artists">Ýmsir flytjendur</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista sconosciuto</string>
<string name="unknown_album">Album sconosciuto</string>
<string name="unknown_genre">Genere sconosciuto</string>
<string name="various_artists">Artisti vari</string>
</resources>
values-he
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">未知のアーティスト</string>
<string name="unknown_album">未知のアルバム</string>
<string name="unknown_genre">未知のジャンル</string>
<string name="various_artists">複数アーティスト</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Anaẓur ur nettwassen ara</string>
<string name="unknown_album">Album ur nettwassen ara</string>
<string name="unknown_genre">Tawsit ur nettwassen ara</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">មិន​ស្គាល់​សិល្បករ</string>
<string name="unknown_album">មិន​ស្គាល់​អាល់ប៊ុម</string>
<string name="unknown_genre">មិន​ស្គាល់​ចង្វាក់</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">ಅಪರಿಚಿತ ಕಲಾವಿದ</string>
<string name="unknown_album">ಅಪರಿಚಿತ ಆಲ್ಬಮ್</string>
<string name="unknown_genre">ಅಪರಿಚಿತ ಶೈಲಿ</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">알 수 없는 아티스트</string>
<string name="unknown_album">알 수 없는 앨범</string>
<string name="unknown_genre">알 수 없는 장르</string>
<string name="various_artists">여러 아티스트</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="list_mode">false</bool>
</resources>
\ No newline at end of file
<resources>
<!-- Default -->
<dimen name="actionBarSize">48dp</dimen>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Nežinomas atlikėjas</string>
<string name="unknown_album">Nežinomas albumas</string>
<string name="unknown_genre">Nežinomas stilius</string>
<string name="various_artists">Įvairūs atlikėjai</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Nezināms Mākslinieks</string>
<string name="unknown_album">Nezināms Albūms</string>
<string name="unknown_genre">Nezināms Žanrs</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">അജ്ഞാത കലാകാരന്‍</string>
<string name="unknown_album">അജ്ഞാത ആല്‍ബം</string>
<string name="unknown_genre">അജ്ഞാത വിഭാഗം</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">अनामिक कलाकार</string>
<string name="unknown_album">अनामिक अल्बम</string>
<string name="unknown_genre">अनामिक जॉनर</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artis Tidak Diketahui</string>
<string name="unknown_album">Album Tidak Diketahui</string>
<string name="unknown_genre">Genre Tidak Diketahui</string>
<string name="various_artists">Pelbagai Artis</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">အမည်မသိအနုပညာရှင်</string>
<string name="unknown_album">အမည်မသိအယ်လဘမ်</string>
<string name="unknown_genre">အမည်မသိအမျိုးအစား</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Ukjent artist</string>
<string name="unknown_album">Ukjent album</string>
<string name="unknown_genre">Ukjent sjanger</string>
<string name="various_artists">Forskjellige artister</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">अज्ञात कलाकार</string>
<string name="unknown_album">अज्ञात एलबम</string>
<string name="unknown_genre">अज्ञात शैली</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Onbekende artiest</string>
<string name="unknown_album">Onbekend album</string>
<string name="unknown_genre">Onbekend genre</string>
<string name="various_artists">Diverse artiesten</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">ଅଜ୍ଞାତ କଳାକାର</string>
<string name="unknown_album">ଅଜ୍ଞାତ ଆଲବମ୍</string>
<string name="unknown_genre">ଅଜ୍ଞାତ ଧରଣ</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">ਅਣਜਾਣ ਕਲਾਕਾਰ</string>
<string name="unknown_album">ਅਣਜਾਣ ਐਲਬਮ</string>
<string name="unknown_genre">ਅਣਜਾਣ ਧੁਨ</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Nieznany wykonawca</string>
<string name="unknown_album">Nieznany album</string>
<string name="unknown_genre">Nieznany gatunek</string>
<string name="various_artists">Różni wykonawcy</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artista Desconhecido</string>
<string name="unknown_album">Álbum Desconhecido</string>
<string name="unknown_genre">Gênero Desconhecido</string>
<string name="various_artists">Vários Artistas</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Intérprete desconhecido</string>
<string name="unknown_album">Álbum desconhecido</string>
<string name="unknown_genre">Género desconhecido</string>
<string name="various_artists">Vários artistas</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artist necunoscut</string>
<string name="unknown_album">Album necunoscut</string>
<string name="unknown_genre">Gen necunoscut</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Неизвестный исполнитель</string>
<string name="unknown_album">Неизвестный альбом</string>
<string name="unknown_genre">Неизвестный жанр</string>
<string name="various_artists">Различные исполнители</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">නොදත් කලාකරු</string>
<string name="unknown_album">නොදත් ඇල්බමය</string>
<string name="unknown_genre">නොදත් ප්‍රභේදය</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Neznámy umelec</string>
<string name="unknown_album">Neznámy album</string>
<string name="unknown_genre">Neznámy žáner</string>
<string name="various_artists">Rôzni umelci</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Neznan izvajalec</string>
<string name="unknown_album">Neznan album</string>
<string name="unknown_genre">Neznana zvrst</string>
<string name="various_artists">Različni izvajalci</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Artiste i panjohur</string>
<string name="unknown_album">Album i panjohur</string>
<string name="unknown_genre">Zhanri i panjohur</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Непознат извођач</string>
<string name="unknown_album">Непознат албум</string>
<string name="unknown_genre">Непознат жанр</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Okänd artist</string>
<string name="unknown_album">Okänt album</string>
<string name="unknown_genre">Okänd genre</string>
<string name="various_artists">Blandade artister</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">தெரியாத கலைஞர்</string>
<string name="unknown_album">தெரியாத தொகுப்பு</string>
<string name="unknown_genre">தெரியாத வகை</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="unknown_artist">తెలియని కళాకారుడు</string>
<string name="unknown_album">తెలియని ఆల్బమ్</string>
<string name="unknown_genre">తెలియని సాహిత్యం</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">ไม่ทราบศิลปิน</string>
<string name="unknown_album">ไม่ทราบอัลบั้ม</string>
<string name="unknown_genre">ไม่ทราบประเภท</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Bilinmeyen Sanatçı</string>
<string name="unknown_album">Bilinmeyen Albüm</string>
<string name="unknown_genre">Bilinmeyen Tür</string>
<string name="various_artists">Çeşitli Sanatçılar</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Билгесез башкаручы</string>
<string name="unknown_album">Билгесез альбом</string>
<string name="unknown_genre">Билгесез жанр</string>
<string name="various_artists">Төрле башкаручылар</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">يوچۇن سەنئەتكار</string>
<string name="unknown_album">يوچۇن توپلام</string>
<string name="unknown_genre">يوچۇن ئېقىم</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Невідомий виконавець</string>
<string name="unknown_album">Невідомий альбом</string>
<string name="unknown_genre">Невідомий жанр</string>
<string name="various_artists">Різні виконавці</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">نامعلوم آرٹِسٹ</string>
<string name="unknown_album">نا معلوم مرقع</string>
<string name="unknown_genre">نامعلوم نوع</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Noma’lum ijrochi</string>
<string name="unknown_album">Noma’lum albom</string>
<string name="unknown_genre">Noma’lum janr</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="unknown_artist">Unknown Artist</string>
<string name="unknown_album">Unknown Album</string>
<string name="unknown_genre">Unknown Genre</string>
<string name="various_artists">Various Artists</string>
</resources>
......@@ -53,7 +53,6 @@ public class Medialibrary {
public static final String VLC_MEDIA_DB_NAME = "/vlc_media.db";
public static final String THUMBS_FOLDER_NAME = "/thumbs";
private Context mContext;
private long mInstanceID;
private volatile boolean mIsInitiated = false;
......@@ -69,6 +68,7 @@ public class Medialibrary {
private final List<EntryPointsEventsCb> entryPointsEventsCbList = new ArrayList<>();
private static Medialibrary sInstance;
private static Context sContext;
static {
LibVLC.loadLibraries();
......@@ -76,10 +76,14 @@ public class Medialibrary {
System.loadLibrary("mla");
}
public static Context getContext() {
return sContext;
}
public boolean init(Context context) {
if (context == null)
return false;
mContext = context;
sContext = context;
File extFilesDir = context.getExternalFilesDir(null);
File dbDirectory = context.getDir("db", Context.MODE_PRIVATE);
if (extFilesDir == null || !extFilesDir.exists())
......@@ -398,7 +402,7 @@ public class Medialibrary {
@SuppressWarnings("unused")
public void onBackgroundTasksIdleChanged(boolean isIdle) {
LocalBroadcastManager.getInstance(mContext).sendBroadcast(new Intent(ACTION_IDLE).putExtra(STATE_IDLE, isIdle));
LocalBroadcastManager.getInstance(sContext).sendBroadcast(new Intent(ACTION_IDLE).putExtra(STATE_IDLE, isIdle));
mIsWorking = !isIdle;
}
......
......@@ -2,11 +2,15 @@ package org.videolan.medialibrary.media;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.R;
public class Album extends MediaLibraryItem {
private static String UNKNOWN_ALBUM;
private int releaseYear;
private String artworkMrl;
private String albumArtist;
......@@ -22,6 +26,16 @@ public class Album extends MediaLibraryItem {
this.albumArtistId = albumArtistId;
this.mTracksCount = nbTracks;
this.duration = duration;
if (TextUtils.isEmpty(title)) {
if (UNKNOWN_ALBUM == null)
UNKNOWN_ALBUM = Medialibrary.getContext().getString(R.string.unknown_album);
mTitle = UNKNOWN_ALBUM;
}
if (TextUtils.isEmpty(albumArtist)) {
if (Artist.UNKNOWN_ARTIST == null)
Artist.UNKNOWN_ARTIST = Medialibrary.getContext().getString(R.string.unknown_artist);
this.albumArtist = Artist.UNKNOWN_ARTIST;
}
}
public long getId() {
......@@ -30,7 +44,7 @@ public class Album extends MediaLibraryItem {
@Override
public String getDescription() {
return mDescription == null ? albumArtist : mDescription;
return albumArtist;
}
public int getReleaseYear() {
......
......@@ -5,6 +5,7 @@ import android.os.Parcelable;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.R;
public class Artist extends MediaLibraryItem {
......@@ -12,11 +13,23 @@ public class Artist extends MediaLibraryItem {
private String artworkMrl;
private String musicBrainzId;
static String UNKNOWN_ARTIST;
private static String VARIOUS_ARTISTS;
public Artist(long id, String name, String shortBio, String artworkMrl, String musicBrainzId) {
super(id, name);
this.shortBio = shortBio;
this.artworkMrl = artworkMrl != null ? VLCUtil.UriFromMrl(artworkMrl).getPath() : null;
this.musicBrainzId = musicBrainzId;
if (id == 1L) {
if (UNKNOWN_ARTIST == null)
UNKNOWN_ARTIST = Medialibrary.getContext().getString(R.string.unknown_artist);
mTitle = UNKNOWN_ARTIST;
} else if (id == 2L) {
if (VARIOUS_ARTISTS == null)
VARIOUS_ARTISTS = Medialibrary.getContext().getString(R.string.various_artists);
mTitle = VARIOUS_ARTISTS;
}
}
public String getShortBio() {
......
......@@ -205,30 +205,7 @@ public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, Audio
public void addAll(ArrayList<MediaLibraryItem> items) {
addAll(items, mMakeSections);
}
public void addAll(ArrayList<MediaLibraryItem> items, boolean generateSections) {
if (mContext == null)
return;