Skip to content

Commit

Permalink
fix: remove hard-coded path separator
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed May 4, 2024
1 parent e43ec61 commit 06f3be1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Shokofin/API/Models/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public string RelativePath
{
if (CachedPath != null)
return CachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + InternalPath
var relativePath = InternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down
2 changes: 1 addition & 1 deletion Shokofin/SignalR/Models/FileEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public string RelativePath
{
if (CachedPath != null)
return CachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + InternalPath
var relativePath = InternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down
6 changes: 3 additions & 3 deletions Shokofin/SignalR/Models/FileMovedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public string PreviousRelativePath
{
if (PreviousCachedPath != null)
return PreviousCachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + PreviousInternalPath
var relativePath = PreviousInternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down Expand Up @@ -80,7 +80,7 @@ public string RelativePath
{
if (CachedPath != null)
return CachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + InternalPath
var relativePath = InternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down Expand Up @@ -111,7 +111,7 @@ public string PreviousRelativePath
{
if (PreviousCachedPath != null)
return PreviousCachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + PreviousInternalPath
var relativePath = PreviousInternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down
2 changes: 1 addition & 1 deletion Shokofin/SignalR/Models/FileRenamedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public string RelativePath
{
if (CachedPath != null)
return CachedPath;
var relativePath = System.IO.Path.DirectorySeparatorChar + InternalPath
var relativePath = InternalPath
.Replace('/', System.IO.Path.DirectorySeparatorChar)
.Replace('\\', System.IO.Path.DirectorySeparatorChar);
if (relativePath[0] != System.IO.Path.DirectorySeparatorChar)
Expand Down

0 comments on commit 06f3be1

Please sign in to comment.