| 237 | } |
| 238 | |
| 239 | static PlaylistFileContents |
| 240 | MaybeLoadPlaylistFile(Path path_fs, PlaylistFileEditor::LoadMode load_mode) |
| 241 | try { |
| 242 | if (load_mode == PlaylistFileEditor::LoadMode::NO) |
| 243 | return {}; |
| 244 | |
| 245 | return LoadPlaylistFile(path_fs); |
| 246 | } catch (const PlaylistError &error) { |
| 247 | if (error.GetCode() == PlaylistResult::NO_SUCH_LIST && |
| 248 | load_mode == PlaylistFileEditor::LoadMode::TRY) |
| 249 | return {}; |
| 250 | |
| 251 | throw; |
| 252 | } |
| 253 | |
| 254 | PlaylistFileEditor::PlaylistFileEditor(const char *name_utf8, |
| 255 | LoadMode load_mode) |
no test coverage detected