Merge branch 'master' into librarysyncservicebounded
This commit is contained in:
commit
69b1a9fcd4
|
@ -4,6 +4,7 @@
|
|||
|
||||
<!-- Permissions -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
@ -21,6 +22,7 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- Intent filter for sharing from youtube player -->
|
||||
|
@ -67,6 +69,12 @@
|
|||
<service android:name="org.xbmc.kore.service.IntentActionsService"
|
||||
android:exported="false"/>
|
||||
|
||||
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow"/>
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598.0dip" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
|
@ -63,7 +63,7 @@ public class LibrarySyncService extends Service {
|
|||
public static final String TAG = LogUtils.makeLogTag(LibrarySyncService.class);
|
||||
|
||||
private static final int LIMIT_SYNC_MOVIES = 300;
|
||||
private static final int LIMIT_SYNC_TVSHOWS = 300;
|
||||
private static final int LIMIT_SYNC_TVSHOWS = 200;
|
||||
private static final int LIMIT_SYNC_ARTISTS = 300;
|
||||
private static final int LIMIT_SYNC_ALBUMS = 300;
|
||||
private static final int LIMIT_SYNC_SONGS = 600;
|
||||
|
@ -702,7 +702,7 @@ public class LibrarySyncService extends Service {
|
|||
startIdx + LIMIT_SYNC_TVSHOWS, allResults);
|
||||
} else {
|
||||
// Ok, we have all the shows, insert them
|
||||
LogUtils.LOGD(TAG, "syncAllTVShows: Got all tv shows");
|
||||
LogUtils.LOGD(TAG, "syncAllTVShows: Got all tv shows. Total: " + allResults.size());
|
||||
deleteTVShows(contentResolver, hostId, -1);
|
||||
insertTVShowsAndGetDetails(orchestrator, hostConnection, callbackHandler,
|
||||
contentResolver, allResults);
|
||||
|
@ -720,6 +720,7 @@ public class LibrarySyncService extends Service {
|
|||
private void deleteTVShows(final ContentResolver contentResolver,
|
||||
int hostId, int tvshowId) {
|
||||
if (tvshowId == -1) {
|
||||
LogUtils.LOGD(TAG, "Deleting all existing tv shows: ");
|
||||
// Delete all tvshows
|
||||
String where = MediaContract.TVShowsColumns.HOST_ID + "=?";
|
||||
contentResolver.delete(MediaContract.Episodes.CONTENT_URI,
|
||||
|
@ -759,6 +760,7 @@ public class LibrarySyncService extends Service {
|
|||
}
|
||||
// Insert the tvshows
|
||||
contentResolver.bulkInsert(MediaContract.TVShows.CONTENT_URI, tvshowsValuesBatch);
|
||||
LogUtils.LOGD(TAG, "Inserted " + tvShows.size() + " tv shows.");
|
||||
|
||||
ContentValues tvshowsCastValuesBatch[] = new ContentValues[castCount];
|
||||
int count = 0;
|
||||
|
@ -923,6 +925,7 @@ public class LibrarySyncService extends Service {
|
|||
}, callbackHandler);
|
||||
} else {
|
||||
// We're finished
|
||||
LogUtils.LOGD(TAG, "Sync tv shows finished successfully");
|
||||
orchestrator.syncItemFinished();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.xbmc.kore.provider.MediaContract;
|
|||
import org.xbmc.kore.provider.MediaDatabase;
|
||||
import org.xbmc.kore.service.LibrarySyncService;
|
||||
import org.xbmc.kore.utils.LogUtils;
|
||||
import org.xbmc.kore.utils.MediaManager;
|
||||
import org.xbmc.kore.utils.MediaPlayerUtils;
|
||||
import org.xbmc.kore.utils.UIUtils;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
|
@ -303,10 +303,10 @@ public class AlbumListFragment extends AbstractMusicListFragment {
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_play:
|
||||
MediaManager.play(AlbumListFragment.this, playListItem);
|
||||
MediaPlayerUtils.play(AlbumListFragment.this, playListItem);
|
||||
return true;
|
||||
case R.id.action_queue:
|
||||
MediaManager.queueAudio(AlbumListFragment.this, playListItem);
|
||||
MediaPlayerUtils.queueAudio(AlbumListFragment.this, playListItem);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.xbmc.kore.jsonrpc.type.PlaylistType;
|
|||
import org.xbmc.kore.provider.MediaContract;
|
||||
import org.xbmc.kore.provider.MediaDatabase;
|
||||
import org.xbmc.kore.utils.LogUtils;
|
||||
import org.xbmc.kore.utils.MediaManager;
|
||||
import org.xbmc.kore.utils.MediaPlayerUtils;
|
||||
import org.xbmc.kore.utils.UIUtils;
|
||||
|
||||
/**
|
||||
|
@ -226,10 +226,10 @@ public class ArtistListFragment extends AbstractMusicListFragment {
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_play:
|
||||
MediaManager.play(ArtistListFragment.this, playListItem);
|
||||
MediaPlayerUtils.play(ArtistListFragment.this, playListItem);
|
||||
return true;
|
||||
case R.id.action_queue:
|
||||
MediaManager.queueAudio(ArtistListFragment.this, playListItem);
|
||||
MediaPlayerUtils.queueAudio(ArtistListFragment.this, playListItem);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -54,7 +54,7 @@ import org.xbmc.kore.jsonrpc.type.PlaylistType;
|
|||
import org.xbmc.kore.provider.MediaContract;
|
||||
import org.xbmc.kore.service.LibrarySyncService;
|
||||
import org.xbmc.kore.utils.LogUtils;
|
||||
import org.xbmc.kore.utils.MediaManager;
|
||||
import org.xbmc.kore.utils.MediaPlayerUtils;
|
||||
import org.xbmc.kore.utils.UIUtils;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
|
@ -235,10 +235,10 @@ public class AudioGenresListFragment extends AbstractMusicListFragment {
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_play:
|
||||
MediaManager.play(AudioGenresListFragment.this, playListItem);
|
||||
MediaPlayerUtils.play(AudioGenresListFragment.this, playListItem);
|
||||
return true;
|
||||
case R.id.action_queue:
|
||||
MediaManager.queueAudio(AudioGenresListFragment.this, playListItem);
|
||||
MediaPlayerUtils.queueAudio(AudioGenresListFragment.this, playListItem);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -232,8 +232,9 @@ public class RemoteFragment extends Fragment
|
|||
R.attr.remoteButtonColorFilter,
|
||||
R.attr.contentBackgroundColor});
|
||||
// R.attr.remoteBackgroundColorFilter});
|
||||
int remoteButtonsColor = styledAttributes.getColor(0, R.color.white),
|
||||
remoteBackgroundColor = styledAttributes.getColor(1, R.color.dark_content_background_dim_70pct);
|
||||
Resources resources = getResources();
|
||||
int remoteButtonsColor = styledAttributes.getColor(0, resources.getColor(R.color.white)),
|
||||
remoteBackgroundColor = styledAttributes.getColor(1, resources.getColor(R.color.dark_content_background_dim_70pct));
|
||||
styledAttributes.recycle();
|
||||
|
||||
leftButton.setColorFilter(remoteButtonsColor);
|
||||
|
@ -344,7 +345,8 @@ public class RemoteFragment extends Fragment
|
|||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
eventServerConnection.sendPacket(packet);
|
||||
if (eventServerConnection != null)
|
||||
eventServerConnection.sendPacket(packet);
|
||||
}
|
||||
}, buttonInAnim, buttonOutAnim, getActivity().getApplicationContext()));
|
||||
}
|
||||
|
|
|
@ -396,7 +396,6 @@ public class TVShowEpisodeDetailsFragment extends Fragment
|
|||
}
|
||||
}, callbackHandler);
|
||||
} else {
|
||||
if (!isAdded()) return;
|
||||
Toast.makeText(getActivity(), R.string.no_suitable_playlist, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
@ -404,6 +403,7 @@ public class TVShowEpisodeDetailsFragment extends Fragment
|
|||
|
||||
@Override
|
||||
public void onError(int errorCode, String description) {
|
||||
if (!isAdded()) return;
|
||||
// Got an error, show toast
|
||||
Toast.makeText(getActivity(), R.string.unable_to_connect_to_xbmc, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
|
|
|
@ -17,6 +17,8 @@ package org.xbmc.kore.ui.hosts;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -118,6 +120,11 @@ public class AddHostFragmentZeroconf extends Fragment {
|
|||
* Starts the service discovery, setting up the UI accordingly
|
||||
*/
|
||||
public void startSearching() {
|
||||
if( ! isNetworkConnected() ) {
|
||||
noNetworkConnection();
|
||||
return;
|
||||
}
|
||||
|
||||
LogUtils.LOGD(TAG, "Starting service discovery...");
|
||||
searchCancelled = false;
|
||||
final Handler handler = new Handler();
|
||||
|
@ -125,6 +132,7 @@ public class AddHostFragmentZeroconf extends Fragment {
|
|||
@Override
|
||||
public void run() {
|
||||
WifiManager wifiManager = (WifiManager)getActivity().getSystemService(Context.WIFI_SERVICE);
|
||||
|
||||
WifiManager.MulticastLock multicastLock = null;
|
||||
try {
|
||||
// Get wifi ip address
|
||||
|
@ -279,6 +287,37 @@ public class AddHostFragmentZeroconf extends Fragment {
|
|||
|
||||
}
|
||||
|
||||
private void noNetworkConnection() {
|
||||
titleTextView.setText(R.string.no_network_connection);
|
||||
messageTextView.setText(Html.fromHtml(getString(R.string.wizard_search_no_network_connection)));
|
||||
messageTextView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
progressBar.setVisibility(View.GONE);
|
||||
hostListGridView.setVisibility(View.GONE);
|
||||
|
||||
nextButton.setVisibility(View.GONE);
|
||||
|
||||
previousButton.setVisibility(View.VISIBLE);
|
||||
previousButton.setText(R.string.search_again);
|
||||
previousButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startSearching();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isNetworkConnected() {
|
||||
ConnectivityManager cm =
|
||||
(ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
boolean isConnected = activeNetwork != null &&
|
||||
activeNetwork.isConnectedOrConnecting();
|
||||
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapter used to show the hosts in the {@link GridView}
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.xbmc.kore.ui.RemoteActivity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MediaManager {
|
||||
public class MediaPlayerUtils {
|
||||
|
||||
/**
|
||||
* Clears current playlist and starts playing item
|
|
@ -276,6 +276,45 @@
|
|||
|
||||
Si vous avez besoin d\'aide, consultez le <b><a href="http://forum.kodi.tv/forumdisplay.php?fid=129">forum</a></b>
|
||||
]]></string>
|
||||
<string name="no_network_connection">Aucune connexion réseau</string>
|
||||
<string name="reboot">Redémarrer</string>
|
||||
<string name="show_notification">Afficher les notifications pendant la lecture</string>
|
||||
<string name="sort_by_date_added">Par date d\'ajout</string>
|
||||
<string name="sort_by_name">Par nom</string>
|
||||
<string name="sort_order">Trier</string>
|
||||
<string name="source_empty">Source vide</string>
|
||||
<string name="subtitle_sync">Synchroniser les sous-titres</string>
|
||||
<string name="use_hardware_volume_keys">Controller le volume avec les boutons de l\'appareil</string>
|
||||
<string name="video">Vidéo</string>
|
||||
<string name="vibrate_on_remote">Vibrer au touché</string>
|
||||
<string name="wizard_invalid_es_port_specified">Veuillez renseigner un port EventServer valide pour ce média.</string>
|
||||
<string name="wizard_search_no_network_connection"><![CDATA[ Veuillez activer une connexion réseau avant de rechercher un centre multimédia. <br/> ]]></string>
|
||||
<string name="wizard_xbmc_event_server_port">ES Port (9777)</string>
|
||||
<string name="wizard_xbmc_use_event_server">Utiliser EventServer</string>
|
||||
<string name="wizard_xbmc_use_tcp">Utiliser TCP</string>
|
||||
<string name="wizard_zeroconf_cant_connect_no_host_address">Connexion à ce centre multimédia impossible car l\'adresse est introuvable.</string>
|
||||
<string name="wizard_zeroconf_no_host_address">Récupération de l\'adresse impossible!</string>
|
||||
<string name="remaining_cast_count">%d plus</string>
|
||||
<string name="queue_file">File d\'attente</string>
|
||||
<string name="play_file">Jouer</string>
|
||||
<string name="play_from_here">Jouer à partir d\'ici</string>
|
||||
<string name="play_on_kodi">Kodi</string>
|
||||
<string name="files">Fichiers</string>
|
||||
<string name="file_browser">Fichiers</string>
|
||||
<string name="error_queue_media_file">Ajout du média impossible.\nErreur: %1$s.</string>
|
||||
<string name="error_play_media_file">Lecture du média impossible.\nErreur: %1$s.</string>
|
||||
<string name="error_getting_source_info">Navigation dans les fichiers impossible.\nErreur: %1$s.</string>
|
||||
<string name="error_get_active_player">Récupération du lecteur actif impossible.\nErreur: %1$s.</string>
|
||||
<string name="context">Contexte</string>
|
||||
<string name="confirm_album_download">Etes-vous sûre de vouloir télécharger cet album?\nCelui-ci sera téléchargé en arrière-plan, mais
|
||||
prendra du temps.</string>
|
||||
<string name="confirm_episode_download">Etes-vous sûre de vouloir télécharger cet épisode?\nCelui-ci sera téléchargé en arrière-plan,
|
||||
mais prendra du temps.</string>
|
||||
<string name="confirm_movie_download">Etes-vous sûre de vouloir télécharger cet album?\nCelui-ci sera téléchargé en arrière-plan, mais
|
||||
prendra du temps.</string>
|
||||
<string name="audio_sync">Synchronisation audio</string>
|
||||
<string name="ignore_prefixes">Ignorer les préfixes</string>
|
||||
<string name="no_cast_info">Aucun acteur à afficher</string>
|
||||
|
||||
<!--<!– String for coffee –>-->
|
||||
<!--<string name="buy_me_coffee">Achetez-moi un café</string>-->
|
||||
|
|
|
@ -247,6 +247,9 @@ Se necessitar de ajuda, visite o nosso <b><a href="http://forum.kodi.tv/forumdis
|
|||
<string name="video">Vídeo</string>
|
||||
<string name="wizard_xbmc_event_server_port">Porto ES (9777)</string>
|
||||
<string name="wizard_xbmc_use_event_server">Usar EventServer</string>
|
||||
<string name="no_network_connection">Nenhuma conexão de rede activa</string>
|
||||
<string name="wizard_invalid_es_port_specified">Por favor especifique um porto válido para o EventServer.</string>
|
||||
<string name="wizard_search_no_network_connection"><![CDATA[Por favor active uma conexão de rede antes de procurar centros multimédia.]]></string>
|
||||
|
||||
<!--<string name="buy_me_coffee">Oferecer um café</string>-->
|
||||
<!--<string name="expresso_please">Expresso, por favor. Obrigado!</string>-->
|
||||
|
|
|
@ -80,9 +80,13 @@
|
|||
I couldn\'t find any media center on your network.<br/>If you need help configuring it, check <a href="http://syncedsynapse.com/kore/kore-faq/>here</a>.<br/><br/>
|
||||
Click <i>Search</i> to search again or <i>Next</i> for manual configuration.
|
||||
]]></string>
|
||||
<string name="wizard_search_no_network_connection"><![CDATA[
|
||||
Please enable a network connection before searching for media centers.<br/>
|
||||
]]></string>
|
||||
<string name="wizard_search_host_found"><![CDATA[
|
||||
I found these media centers on your network.<br/><br/>Select one to add or press <i>Next</i> to manually add a new one.
|
||||
]]></string>
|
||||
<string name="no_network_connection">No network connection</string>
|
||||
<string name="searching">Searching…</string>
|
||||
<string name="no_xbmc_found">No media center found</string>
|
||||
<string name="xbmc_found">Media center found</string>
|
||||
|
|
|
@ -24,22 +24,22 @@
|
|||
android:entryValues="@array/themes_values_array"
|
||||
android:defaultValue="0"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:key="pref_switch_to_remote_after_media_start"
|
||||
android:title="@string/switch_to_remote"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:key="pref_show_notification"
|
||||
android:title="@string/show_notification"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:key="pref_use_hardware_volume_keys"
|
||||
android:title="@string/use_hardware_volume_keys"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:key="pref_vibrate_remote_buttons"
|
||||
android:title="@string/vibrate_on_remote"
|
||||
android:defaultValue="false"/>
|
||||
|
|
Loading…
Reference in New Issue