update download progress reporting

This commit is contained in:
Luke Pulverenti 2017-11-03 14:11:04 -04:00
parent 7174ee66d5
commit 0d28929e17
40 changed files with 84 additions and 482 deletions

View file

@ -117,7 +117,6 @@
<Compile Include="IO\ManagedFileSystem.cs" />
<Compile Include="IO\MbLinkShortcutHandler.cs" />
<Compile Include="IO\MemoryStreamProvider.cs" />
<Compile Include="IO\ProgressStream.cs" />
<Compile Include="IO\SharpCifsFileSystem.cs" />
<Compile Include="IO\SharpCifs\Config.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcBind.cs" />

View file

@ -16,6 +16,7 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Controller.IO;
namespace Emby.Server.Implementations.HttpClientManager
{
@ -633,12 +634,9 @@ namespace Emby.Server.Implementations.HttpClientManager
}
else
{
using (var stream = ProgressStream.CreateReadProgressStream(httpResponse.GetResponseStream(), options.Progress.Report, contentLength.Value))
using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
{
using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
{
await stream.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, options.CancellationToken).ConfigureAwait(false);
}
await StreamHelper.CopyToAsync(httpResponse.GetResponseStream(), fs, StreamDefaults.DefaultCopyToBufferSize, options.Progress, contentLength.Value, options.CancellationToken).ConfigureAwait(false);
}
}

View file

@ -1,240 +0,0 @@
using System;
using System.IO;
namespace Emby.Server.Implementations.IO
{
/// <summary>
/// Measures progress when reading from a stream or writing to one
/// </summary>
public class ProgressStream : Stream
{
/// <summary>
/// Gets the base stream.
/// </summary>
/// <value>The base stream.</value>
public Stream BaseStream { get; private set; }
/// <summary>
/// Gets or sets the bytes processed.
/// </summary>
/// <value>The bytes processed.</value>
private long BytesProcessed { get; set; }
/// <summary>
/// Gets or sets the length of the write.
/// </summary>
/// <value>The length of the write.</value>
private long WriteLength { get; set; }
/// <summary>
/// Gets or sets the length of the read.
/// </summary>
/// <value>The length of the read.</value>
private long? ReadLength { get; set; }
/// <summary>
/// Gets or sets the progress action.
/// </summary>
/// <value>The progress action.</value>
private Action<double> ProgressAction { get; set; }
/// <summary>
/// Creates the read progress stream.
/// </summary>
/// <param name="baseStream">The base stream.</param>
/// <param name="progressAction">The progress action.</param>
/// <param name="readLength">Length of the read.</param>
/// <returns>ProgressStream.</returns>
public static ProgressStream CreateReadProgressStream(Stream baseStream, Action<double> progressAction, long? readLength = null)
{
return new ProgressStream
{
BaseStream = baseStream,
ProgressAction = progressAction,
ReadLength = readLength
};
}
/// <summary>
/// Creates the write progress stream.
/// </summary>
/// <param name="baseStream">The base stream.</param>
/// <param name="progressAction">The progress action.</param>
/// <param name="writeLength">Length of the write.</param>
/// <returns>ProgressStream.</returns>
public static ProgressStream CreateWriteProgressStream(Stream baseStream, Action<double> progressAction, long writeLength)
{
return new ProgressStream
{
BaseStream = baseStream,
ProgressAction = progressAction,
WriteLength = writeLength
};
}
/// <summary>
/// When overridden in a derived class, gets a value indicating whether the current stream supports reading.
/// </summary>
/// <value><c>true</c> if this instance can read; otherwise, <c>false</c>.</value>
/// <returns>true if the stream supports reading; otherwise, false.</returns>
public override bool CanRead
{
get { return BaseStream.CanRead; }
}
/// <summary>
/// When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
/// </summary>
/// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
/// <returns>true if the stream supports seeking; otherwise, false.</returns>
public override bool CanSeek
{
get { return BaseStream.CanSeek; }
}
/// <summary>
/// When overridden in a derived class, gets a value indicating whether the current stream supports writing.
/// </summary>
/// <value><c>true</c> if this instance can write; otherwise, <c>false</c>.</value>
/// <returns>true if the stream supports writing; otherwise, false.</returns>
public override bool CanWrite
{
get { return BaseStream.CanWrite; }
}
/// <summary>
/// When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
/// </summary>
public override void Flush()
{
BaseStream.Flush();
}
/// <summary>
/// When overridden in a derived class, gets the length in bytes of the stream.
/// </summary>
/// <value>The length.</value>
/// <returns>A long value representing the length of the stream in bytes.</returns>
public override long Length
{
get { return BaseStream.Length; }
}
/// <summary>
/// When overridden in a derived class, gets or sets the position within the current stream.
/// </summary>
/// <value>The position.</value>
/// <returns>The current position within the stream.</returns>
public override long Position
{
get { return BaseStream.Position; }
set
{
BaseStream.Position = value;
}
}
/// <summary>
/// When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
/// </summary>
/// <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between <paramref name="offset" /> and (<paramref name="offset" /> + <paramref name="count" /> - 1) replaced by the bytes read from the current source.</param>
/// <param name="offset">The zero-based byte offset in <paramref name="buffer" /> at which to begin storing the data read from the current stream.</param>
/// <param name="count">The maximum number of bytes to be read from the current stream.</param>
/// <returns>The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.</returns>
public override int Read(byte[] buffer, int offset, int count)
{
var read = BaseStream.Read(buffer, offset, count);
BytesProcessed += read;
double percent = BytesProcessed;
percent /= ReadLength ?? BaseStream.Length;
percent *= 100;
ProgressAction(percent);
return read;
}
public override int EndRead(IAsyncResult asyncResult)
{
var read = base.EndRead(asyncResult);
BytesProcessed += read;
double percent = BytesProcessed;
percent /= ReadLength ?? BaseStream.Length;
percent *= 100;
ProgressAction(percent);
return read;
}
/// <summary>
/// When overridden in a derived class, sets the position within the current stream.
/// </summary>
/// <param name="offset">A byte offset relative to the <paramref name="origin" /> parameter.</param>
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin" /> indicating the reference point used to obtain the new position.</param>
/// <returns>The new position within the current stream.</returns>
public override long Seek(long offset, SeekOrigin origin)
{
return BaseStream.Seek(offset, origin);
}
/// <summary>
/// When overridden in a derived class, sets the length of the current stream.
/// </summary>
/// <param name="value">The desired length of the current stream in bytes.</param>
public override void SetLength(long value)
{
BaseStream.SetLength(value);
}
/// <summary>
/// When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
/// </summary>
/// <param name="buffer">An array of bytes. This method copies <paramref name="count" /> bytes from <paramref name="buffer" /> to the current stream.</param>
/// <param name="offset">The zero-based byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream.</param>
/// <param name="count">The number of bytes to be written to the current stream.</param>
public override void Write(byte[] buffer, int offset, int count)
{
BaseStream.Write(buffer, offset, count);
BytesProcessed += count;
double percent = BytesProcessed;
percent /= WriteLength;
percent *= 100;
ProgressAction(percent);
}
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
var result = base.BeginWrite(buffer, offset, count, callback, state);
BytesProcessed += count;
double percent = BytesProcessed;
percent /= WriteLength;
percent *= 100;
ProgressAction(percent);
return result;
}
/// <summary>
/// Releases the unmanaged resources used by the <see cref="T:System.IO.Stream" /> and optionally releases the managed resources.
/// </summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
BaseStream.Dispose();
}
base.Dispose(disposing);
}
}
}

View file

@ -87,10 +87,5 @@
"User": "\u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645",
"System": "\u0627\u0644\u0646\u0638\u0627\u0645",
"Application": "\u0627\u0644\u062a\u0637\u0628\u064a\u0642",
"Plugin": "\u0627\u0644\u0645\u0644\u062d\u0642",
"LabelExit": "\u062e\u0631\u0648\u062c",
"LabelVisitCommunity": "\u0632\u064a\u0627\u0631\u0629 \u0627\u0644\u0645\u062c\u062a\u0645\u0639",
"LabelBrowseLibrary": "\u062a\u0635\u0641\u062d \u0627\u0644\u0645\u0643\u062a\u0628\u0629",
"LabelConfigureServer": "\u0636\u0628\u0637 \u0625\u0639\u062f\u0627\u062f\u0627\u062a \u0623\u0645\u0628\u064a",
"LabelRestartServer": "\u0625\u0639\u0627\u062f\u0629 \u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u062e\u0627\u062f\u0645"
"Plugin": "\u0627\u0644\u0645\u0644\u062d\u0642"
}

View file

@ -6,7 +6,7 @@
"Music": "\u041c\u0443\u0437\u0438\u043a\u0430",
"Games": "\u0418\u0433\u0440\u0438",
"Photos": "\u0421\u043d\u0438\u043c\u043a\u0438",
"MixedContent": "Mixed content",
"MixedContent": "\u0421\u043c\u0435\u0441\u0435\u043d\u043e \u0441\u044a\u0434\u044a\u0440\u0436\u0430\u043d\u0438\u0435",
"MusicVideos": "\u041c\u0443\u0437\u0438\u043a\u0430\u043b\u043d\u0438 \u043a\u043b\u0438\u043f\u043e\u0432\u0435",
"HomeVideos": "\u0414\u043e\u043c\u0430\u0448\u043d\u0438 \u043a\u043b\u0438\u043f\u043e\u0432\u0435",
"Playlists": "\u0421\u043f\u0438\u0441\u044a\u0446\u0438",
@ -17,8 +17,8 @@
"HeaderAlbumArtists": "\u0418\u0437\u043f\u044a\u043b\u043d\u0438\u0442\u0435\u043b\u0438 \u043d\u0430 \u0430\u043b\u0431\u0443\u043c\u0438",
"HeaderFavoriteAlbums": "\u041b\u044e\u0431\u0438\u043c\u0438 \u0430\u043b\u0431\u0443\u043c\u0438",
"HeaderFavoriteEpisodes": "\u041b\u044e\u0431\u0438\u043c\u0438 \u0435\u043f\u0438\u0437\u043e\u0434\u0438",
"HeaderFavoriteShows": "Favorite Shows",
"HeaderNextUp": "Next Up",
"HeaderFavoriteShows": "\u041b\u044e\u0431\u0438\u043c\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438",
"HeaderNextUp": "\u0421\u043b\u0435\u0434\u0432\u0430",
"Favorites": "\u041b\u044e\u0431\u0438\u043c\u0438",
"Collections": "\u041a\u043e\u043b\u0435\u043a\u0446\u0438\u0438",
"Channels": "\u041a\u0430\u043d\u0430\u043b\u0438",
@ -27,28 +27,28 @@
"Artists": "\u0418\u0437\u043f\u044a\u043b\u043d\u0438\u0442\u0435\u043b\u0438",
"Folders": "\u041f\u0430\u043f\u043a\u0438",
"Songs": "\u041f\u0435\u0441\u043d\u0438",
"TvShows": "TV Shows",
"TvShows": "\u0422\u0435\u043b\u0435\u0432\u0438\u0437\u0438\u043e\u043d\u043d\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438",
"Shows": "\u0421\u0435\u0440\u0438\u0430\u043b\u0438",
"Genres": "\u0416\u0430\u043d\u0440\u043e\u0432\u0435",
"NameSeasonNumber": "\u0421\u0435\u0437\u043e\u043d {0}",
"AppDeviceValues": "App: {0}, Device: {1}",
"AppDeviceValues": "\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u0430: {0}, \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e: {1}",
"UserDownloadingItemWithValues": "{0} is downloading {1}",
"HeaderLiveTV": "Live TV",
"ChapterNameValue": "Chapter {0}",
"HeaderLiveTV": "\u0422\u0435\u043b\u0435\u0432\u0438\u0437\u0438\u044f \u043d\u0430 \u0436\u0438\u0432\u043e",
"ChapterNameValue": "\u0413\u043b\u0430\u0432\u0430 {0}",
"ScheduledTaskFailedWithName": "{0} failed",
"LabelRunningTimeValue": "Running time: {0}",
"ScheduledTaskStartedWithName": "{0} \u0437\u0430\u043f\u043e\u0447\u043d\u0430",
"VersionNumber": "Version {0}",
"PluginInstalledWithName": "{0} was installed",
"StartupEmbyServerIsLoading": "Emby Server is loading. Please try again shortly.",
"PluginUpdatedWithName": "{0} was updated",
"VersionNumber": "\u0412\u0435\u0440\u0441\u0438\u044f {0}",
"PluginInstalledWithName": "{0} \u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u043e",
"StartupEmbyServerIsLoading": "\u0421\u044a\u0440\u0432\u044a\u0440\u044a\u0442 \u0437\u0430\u0440\u0435\u0436\u0434\u0430. \u041c\u043e\u043b\u044f, \u043e\u043f\u0438\u0442\u0430\u0439\u0442\u0435 \u043e\u0442\u043d\u043e\u0432\u043e \u0441\u043b\u0435\u0434 \u043c\u0430\u043b\u043a\u043e.",
"PluginUpdatedWithName": "{0} \u0435 \u043e\u0431\u043d\u043e\u0432\u0435\u043d\u043e",
"PluginUninstalledWithName": "{0} \u0435 \u0434\u0435\u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u043e",
"ItemAddedWithName": "{0} was added to the library",
"ItemRemovedWithName": "{0} was removed from the library",
"LabelIpAddressValue": "Ip address: {0}",
"DeviceOnlineWithName": "{0} is connected",
"UserOnlineFromDevice": "{0} is online from {1}",
"ProviderValue": "Provider: {0}",
"ItemAddedWithName": "{0} \u0435 \u0434\u043e\u0431\u0430\u0432\u0435\u043d\u043e \u043a\u044a\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0442\u0430",
"ItemRemovedWithName": "{0} \u0435 \u043f\u0440\u0435\u043c\u0430\u0445\u043d\u0430\u0442\u043e \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0442\u0430",
"LabelIpAddressValue": "\u0418\u041f \u0430\u0434\u0440\u0435\u0441: {0}",
"DeviceOnlineWithName": "{0} \u0435 \u0441\u0432\u044a\u0440\u0437\u0430\u043d",
"UserOnlineFromDevice": "{0} \u0435 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f \u043e\u0442 {1}",
"ProviderValue": "\u0414\u043e\u0441\u0442\u0430\u0432\u0447\u0438\u043a: {0}",
"SubtitlesDownloadedForItem": "Subtitles downloaded for {0}",
"UserCreatedWithName": "User {0} has been created",
"UserPasswordChangedWithName": "Password has been changed for user {0}",
@ -77,7 +77,7 @@
"NotificationOptionGamePlaybackStopped": "Game playback stopped",
"NotificationOptionTaskFailed": "Scheduled task failure",
"NotificationOptionInstallationFailed": "Installation failure",
"NotificationOptionNewLibraryContent": "New content added",
"NotificationOptionNewLibraryContent": "\u0414\u043e\u0431\u0430\u0432\u0435\u043d\u043e \u0435 \u043d\u043e\u0432\u043e \u0441\u044a\u0434\u044a\u0440\u0436\u0430\u043d\u0438\u0435",
"NotificationOptionCameraImageUploaded": "Camera image uploaded",
"NotificationOptionUserLockedOut": "User locked out",
"NotificationOptionServerRestartRequired": "\u041d\u0443\u0436\u043d\u043e \u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0443\u0441\u043a\u0430\u043d\u0435 \u043d\u0430 \u0441\u044a\u0440\u0432\u044a\u0440\u0430",
@ -86,11 +86,6 @@
"Sync": "\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0430\u043d\u0435",
"User": "\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b",
"System": "\u0421\u0438\u0441\u0442\u0435\u043c\u0430",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "\u041f\u043e\u0441\u0435\u0442\u0435\u0442\u0435 \u043e\u0431\u0449\u043d\u043e\u0441\u0442\u0442\u0430",
"LabelBrowseLibrary": "\u0420\u0430\u0437\u0433\u043b\u0435\u0436\u0434\u0430\u043d\u0435 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0442\u0430",
"LabelConfigureServer": "\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0415\u043c\u0431\u0438",
"LabelRestartServer": "\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0443\u0441\u043a\u0430\u043d\u0435 \u043d\u0430 \u0441\u044a\u0440\u0432\u044a\u0440\u0430"
"Application": "\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u0430",
"Plugin": "\u041f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "U\u017eivatel",
"System": "Syst\u00e9m",
"Application": "Aplikace",
"Plugin": "Z\u00e1suvn\u00fd modul",
"LabelExit": "Uko\u010dit",
"LabelVisitCommunity": "Nav\u0161t\u00edvit komunitu",
"LabelBrowseLibrary": "Proch\u00e1zet knihovnu",
"LabelConfigureServer": "Konfigurovat Emby",
"LabelRestartServer": "Restartovat Server"
"Plugin": "Z\u00e1suvn\u00fd modul"
}

View file

@ -87,10 +87,5 @@
"User": "Bruger",
"System": "System",
"Application": "Applikation",
"Plugin": "Plugin",
"LabelExit": "Afslut",
"LabelVisitCommunity": "Bes\u00f8g F\u00e6llesskab",
"LabelBrowseLibrary": "Gennemse Bibliotek",
"LabelConfigureServer": "Konfigurer Emby",
"LabelRestartServer": "Genstart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Benutzer",
"System": "System",
"Application": "Anwendung",
"Plugin": "Plugin",
"LabelExit": "Beenden",
"LabelVisitCommunity": "Besuche die Community",
"LabelBrowseLibrary": "Bibliothek durchsuchen",
"LabelConfigureServer": "Konfiguriere Emby",
"LabelRestartServer": "Server neustarten"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Usuario",
"System": "Sistema",
"Application": "Aplicaci\u00f3n",
"Plugin": "Complemento",
"LabelExit": "Salir",
"LabelVisitCommunity": "Visitar la Comunidad",
"LabelBrowseLibrary": "Explorar Biblioteca",
"LabelConfigureServer": "Configurar Emby",
"LabelRestartServer": "Reiniciar el Servidor"
"Plugin": "Complemento"
}

View file

@ -27,7 +27,7 @@
"Artists": "Artistas",
"Folders": "Carpetas",
"Songs": "Canciones",
"TvShows": "TV Shows",
"TvShows": "Series TV",
"Shows": "Series",
"Genres": "G\u00e9neros",
"NameSeasonNumber": "Temporada {0}",
@ -61,8 +61,8 @@
"AuthenticationSucceededWithUserName": "{0} autenticado correctamente",
"UserOfflineFromDevice": "{0} se ha desconectado de {1}",
"DeviceOfflineWithName": "{0} se ha desconectado",
"UserStartedPlayingItemWithValues": "{0} ha comenzado jugando {1}",
"UserStoppedPlayingItemWithValues": "{0} ha dejado de reproducir {1}",
"UserStartedPlayingItemWithValues": "{0} ha comenzado reproducir {1}",
"UserStoppedPlayingItemWithValues": "{0} ha parado de reproducir {1}",
"NotificationOptionPluginError": "Error en plugin",
"NotificationOptionApplicationUpdateAvailable": "Actualizaci\u00f3n de la aplicaci\u00f3n disponible",
"NotificationOptionApplicationUpdateInstalled": "Actualizaci\u00f3n de la aplicaci\u00f3n instalada",
@ -87,10 +87,5 @@
"User": "Usuario",
"System": "Sistema",
"Application": "Aplicaci\u00f3n",
"Plugin": "Plugin",
"LabelExit": "Salida",
"LabelVisitCommunity": "Visita la Comunidad",
"LabelBrowseLibrary": "Navegar la biblioteca",
"LabelConfigureServer": "Configurar Emby",
"LabelRestartServer": "Configurar Emby"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Utilisateur",
"System": "Syst\u00e8me",
"Application": "Application",
"Plugin": "Extension",
"LabelExit": "Quitter",
"LabelVisitCommunity": "Visiter la communaut\u00e9",
"LabelBrowseLibrary": "Parcourir la m\u00e9diath\u00e8que",
"LabelConfigureServer": "Configurer Emby",
"LabelRestartServer": "Red\u00e9marrer le serveur"
"Plugin": "Extension"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Korisnik",
"System": "Sistem",
"Application": "Aplikacija",
"Plugin": "Dodatak",
"LabelExit": "Izlaz",
"LabelVisitCommunity": "Posjeti zajednicu",
"LabelBrowseLibrary": "Pregledaj biblioteku",
"LabelConfigureServer": "Podesi Emby",
"LabelRestartServer": "Restartiraj Server"
"Plugin": "Dodatak"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Kil\u00e9p\u00e9s",
"LabelVisitCommunity": "K\u00f6z\u00f6ss\u00e9g",
"LabelBrowseLibrary": "M\u00e9diat\u00e1r tall\u00f3z\u00e1sa",
"LabelConfigureServer": "Emby konfigur\u00e1l\u00e1sa",
"LabelRestartServer": "Szerver \u00fajraindit\u00e1sa"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Utente",
"System": "Sistema",
"Application": "Applicazione",
"Plugin": "Plug-in",
"LabelExit": "Esci",
"LabelVisitCommunity": "Visita il forum di discussione",
"LabelBrowseLibrary": "Esplora la libreria",
"LabelConfigureServer": "Configura Emby",
"LabelRestartServer": "Riavvia Server"
"Plugin": "Plug-in"
}

View file

@ -87,10 +87,5 @@
"User": "\u041f\u0430\u0439\u0434\u0430\u043b\u0430\u043d\u0443\u0448\u044b",
"System": "\u0416\u04af\u0439\u0435",
"Application": "\u049a\u043e\u043b\u0434\u0430\u043d\u0431\u0430",
"Plugin": "\u041f\u043b\u0430\u0433\u0438\u043d",
"LabelExit": "\u0428\u044b\u0493\u0443",
"LabelVisitCommunity": "\u049a\u0430\u0443\u044b\u043c\u0434\u0430\u0441\u0442\u044b\u049b\u049b\u0430 \u0431\u0430\u0440\u0443",
"LabelBrowseLibrary": "\u0422\u0430\u0441\u044b\u0493\u044b\u0448\u0445\u0430\u043d\u0430\u043d\u044b \u0448\u043e\u043b\u0443",
"LabelConfigureServer": "Emby \u0442\u0435\u04a3\u0448\u0435\u0443",
"LabelRestartServer": "\u0421\u0435\u0440\u0432\u0435\u0440\u0434\u0456 \u049b\u0430\u0439\u0442\u0430 \u0456\u0441\u043a\u0435 \u049b\u043e\u0441\u0443"
"Plugin": "\u041f\u043b\u0430\u0433\u0438\u043d"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Bruker",
"System": "System",
"Application": "Applikasjon",
"Plugin": "Plugin",
"LabelExit": "Avslutt",
"LabelVisitCommunity": "Bes\u00f8k Samfunnet",
"LabelBrowseLibrary": "Bla i biblioteket",
"LabelConfigureServer": "Konfigurere Emby",
"LabelRestartServer": "Start om serveren"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Gebruiker",
"System": "Systeem",
"Application": "Toepassing",
"Plugin": "Plug-in",
"LabelExit": "Afsluiten",
"LabelVisitCommunity": "Bezoek Gemeenschap",
"LabelBrowseLibrary": "Bekijk bibliotheek",
"LabelConfigureServer": "Emby Configureren",
"LabelRestartServer": "Server herstarten"
"Plugin": "Plug-in"
}

View file

@ -27,7 +27,7 @@
"Artists": "Wykonawcy",
"Folders": "Foldery",
"Songs": "Utwory",
"TvShows": "TV Shows",
"TvShows": "Seriale",
"Shows": "Seriale",
"Genres": "Gatunki",
"NameSeasonNumber": "Sezon {0}",
@ -87,10 +87,5 @@
"User": "U\u017cytkownik",
"System": "System",
"Application": "Aplikacja",
"Plugin": "Wtyczka",
"LabelExit": "Wyj\u015bcie",
"LabelVisitCommunity": "Odwied\u017a spo\u0142eczno\u015b\u0107",
"LabelBrowseLibrary": "Przegl\u0105daj bibliotek\u0119",
"LabelConfigureServer": "Konfiguracja Emby",
"LabelRestartServer": "Uruchom serwer ponownie"
"Plugin": "Wtyczka"
}

View file

@ -87,10 +87,5 @@
"User": "Usu\u00e1rio",
"System": "Sistema",
"Application": "Aplicativo",
"Plugin": "Plugin",
"LabelExit": "Sair",
"LabelVisitCommunity": "Visite a Comunidade",
"LabelBrowseLibrary": "Explorar Biblioteca",
"LabelConfigureServer": "Configurar Emby",
"LabelRestartServer": "Reiniciar Servidor"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Aplica\u00e7\u00e3o",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "\u041f\u043e\u043b\u044c\u0437-\u043b\u044c",
"System": "\u0421\u0438\u0441\u0442\u0435\u043c\u0430",
"Application": "\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435",
"Plugin": "\u041f\u043b\u0430\u0433\u0438\u043d",
"LabelExit": "\u0412\u044b\u0445\u043e\u0434",
"LabelVisitCommunity": "\u041f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0435 \u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430",
"LabelBrowseLibrary": "\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0435",
"LabelConfigureServer": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Emby",
"LabelRestartServer": "\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430"
"Plugin": "\u041f\u043b\u0430\u0433\u0438\u043d"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "Anv\u00e4ndare",
"System": "System",
"Application": "App",
"Plugin": "Till\u00e4gg",
"LabelExit": "Avsluta",
"LabelVisitCommunity": "Bes\u00f6k v\u00e5rt diskussionsforum",
"LabelBrowseLibrary": "Bl\u00e4ddra i biblioteket",
"LabelConfigureServer": "Konfigurera Emby",
"LabelRestartServer": "Starta om servern"
"Plugin": "Till\u00e4gg"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "Visit Community",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -87,10 +87,5 @@
"User": "\u7528\u6237",
"System": "\u7cfb\u7edf",
"Application": "\u5e94\u7528\u7a0b\u5e8f",
"Plugin": "\u63d2\u4ef6",
"LabelExit": "\u9000\u51fa",
"LabelVisitCommunity": "\u8bbf\u95ee\u793e\u533a",
"LabelBrowseLibrary": "\u6d4f\u89c8\u5a92\u4f53\u5e93",
"LabelConfigureServer": "\u914d\u7f6e Emby",
"LabelRestartServer": "\u91cd\u542f\u670d\u52a1\u5668"
"Plugin": "\u63d2\u4ef6"
}

View file

@ -87,10 +87,5 @@
"User": "User",
"System": "System",
"Application": "Application",
"Plugin": "Plugin",
"LabelExit": "Exit",
"LabelVisitCommunity": "\u8a2a\u554f\u8a0e\u8ad6\u5340",
"LabelBrowseLibrary": "Browse Library",
"LabelConfigureServer": "Configure Emby",
"LabelRestartServer": "Restart Server"
"Plugin": "Plugin"
}

View file

@ -464,6 +464,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// <param name="e">The e.</param>
void progress_ProgressChanged(object sender, double e)
{
e = Math.Min(e, 100);
CurrentProgress = e;
EventHelper.FireEventIfNotNull(TaskProgress, this, new GenericEventArgs<double>

View file

@ -1376,11 +1376,6 @@ namespace MediaBrowser.Controller.Entities
return list;
}
internal virtual bool IsValidFromResolver(BaseItem newItem)
{
return true;
}
internal virtual ItemUpdateType UpdateFromResolvedItem(BaseItem newItem)
{
var updateType = ItemUpdateType.None;

View file

@ -265,21 +265,6 @@ namespace MediaBrowser.Controller.Entities
return changed;
}
internal override bool IsValidFromResolver(BaseItem newItem)
{
var newCollectionFolder = newItem as CollectionFolder;
if (newCollectionFolder != null)
{
if (!string.Equals(CollectionType, newCollectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return false;
}
}
return base.IsValidFromResolver(newItem);
}
private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService, bool setPhysicalLocations)
{
var path = ContainingFolderPath;

View file

@ -416,7 +416,7 @@ namespace MediaBrowser.Controller.Entities
{
BaseItem currentChild;
if (currentChildren.TryGetValue(child.Id, out currentChild) && currentChild.IsValidFromResolver(child))
if (currentChildren.TryGetValue(child.Id, out currentChild))
{
validChildren.Add(currentChild);

View file

@ -1,6 +1,7 @@
using System.IO;
using System.Threading;
using System;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.IO
{
@ -23,5 +24,27 @@ namespace MediaBrowser.Controller.IO
}
}
}
public static async Task CopyToAsync(Stream source, Stream destination, int bufferSize, IProgress<double> progress, long contentLength, CancellationToken cancellationToken)
{
byte[] buffer = new byte[bufferSize];
int read;
long totalRead = 0;
while ((read = source.Read(buffer, 0, buffer.Length)) != 0)
{
cancellationToken.ThrowIfCancellationRequested();
destination.Write(buffer, 0, read);
totalRead += read;
double pct = totalRead;
pct /= contentLength;
pct *= 100;
progress.Report(pct);
}
}
}
}