Mercurial > minori
comparison src/library/library.cc @ 393:963047512d34
*: clang-format
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 07 Nov 2025 07:16:15 -0500 |
| parents | 27c462bc7815 |
| children | 650a9159a0e7 |
comparison
equal
deleted
inserted
replaced
| 392:a72d6d7b3568 | 393:963047512d34 |
|---|---|
| 24 /* TODO also need to remove unused watchers */ | 24 /* TODO also need to remove unused watchers */ |
| 25 for (const auto &p : session.config.library.paths) { | 25 for (const auto &p : session.config.library.paths) { |
| 26 if (watchers_.count(p)) | 26 if (watchers_.count(p)) |
| 27 continue; | 27 continue; |
| 28 | 28 |
| 29 watchers_[p].reset(Filesystem::GetRecursiveFilesystemWatcher(reinterpret_cast<void *>(this), p, Database::StaticEventHandler)); | 29 watchers_[p].reset( |
| 30 Filesystem::GetRecursiveFilesystemWatcher(reinterpret_cast<void *>(this), p, Database::StaticEventHandler)); | |
| 30 } | 31 } |
| 31 } | 32 } |
| 32 | 33 |
| 33 bool Database::GetPathAnimeAndEpisode(const std::string &basename, int *aid, int *ep) | 34 bool Database::GetPathAnimeAndEpisode(const std::string &basename, int *aid, int *ep) |
| 34 { | 35 { |
| 41 | 42 |
| 42 const int id = Anime::db.LookupAnimeTitle(title); | 43 const int id = Anime::db.LookupAnimeTitle(title); |
| 43 if (id <= 0 || (find_id_ && find_id_.value() != id)) | 44 if (id <= 0 || (find_id_ && find_id_.value() != id)) |
| 44 return false; | 45 return false; |
| 45 | 46 |
| 46 const int episode = | 47 const int episode = Strings::ToInt<int>(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber))); |
| 47 Strings::ToInt<int>(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber))); | |
| 48 | 48 |
| 49 *aid = id; | 49 *aid = id; |
| 50 *ep = episode; | 50 *ep = episode; |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
