浏览代码

Merge pull request #5725 from BrianCArnold/Fix2845_PlaylistDeletion

Claus Vium 4 年之前
父节点
当前提交
9d0467addf
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      MediaBrowser.Controller/Playlists/Playlist.cs

+ 3 - 1
MediaBrowser.Controller/Playlists/Playlist.cs

@@ -3,6 +3,7 @@
 using System;
 using System.Collections.Generic;
 using System.Globalization;
+using System.IO;
 using System.Linq;
 using System.Text.Json.Serialization;
 using System.Threading;
@@ -43,7 +44,8 @@ namespace MediaBrowser.Controller.Playlists
 
         public static bool IsPlaylistFile(string path)
         {
-            return System.IO.Path.HasExtension(path);
+            // The path will sometimes be a directory and "Path.HasExtension" returns true if the name contains a '.' (dot).
+            return System.IO.Path.HasExtension(path) && !Directory.Exists(path);
         }
 
         [JsonIgnore]