-
Notifications
You must be signed in to change notification settings - Fork 138
added Created/Modified fields (closes #1701) #1705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ing on win) added new datetime type need to copare dates compare datetime using int64 for datetimes added get set dt (datetime) using time_t adding win support fix tuple to_filed_map match date ignore build dir ignore compile commands defaults to -1 ignore .cache remove debug print
|
It's always nice to see a pull request for a feature from the same person who requested it. Thanks for working on this. 👍 I agree it would be nice to show the dates in the technical section in the Qt info dialog. Formatted though would be better in my opinion. And yes, it is buggy right now. The value changes every time when reopening the dialog and can even show negative values. The timestamps should also be persisted. After restarting Audacious they are gone (playlist column is empty) and you need to refresh the files manually. The code changes look fine to me from a first glance. Things to consider:
Playlist::Created, // created
Playlist::Modified, // modified
@jlindgren90: Could you please review the changes as well? Especially since they affect the fundamentals of Audacious. Testing on Windows would of course be nice too. Thanks in advance. |
|
Yeah I called it set_dt, I was blindly following the neighboring function naming conventions (... set_str rather then set_string...) that is the only reason, I see how that would be ambiguous now, sorry... also what should the Created, Modified enums be called? maybe something like FileCreated, FileModified, yeah same thing happened, I kept it simple since there was a Path enum and not a FilePath or FileName... I did see that playlists don't persist datetimes when you reopen, I'll take some time adding that when I learn how audacious saves them... Also following locale preferences might be my biggest priority first. Thanks for the review. |
|
Reading more about creation dates, this seems to be more complicated than expected. https://lwn.net/Articles/397442/ My impression is that we should not write custom and platform dependent code for this. Using GIO instead could be an option but a) it is not available yet in libaudcore Let's wait for John's response and recommendations on this matter. |
|
This looks like a good start, thanks. Some thoughts:
|
|
So keep the DateTime type or replace it with Int64... or have both that represent the same thing (int64_t)? I guess keep both? |
src/libaudcore/audstrings.cc
Outdated
| EXPORT StringBuf int64_to_str(int64_t val) | ||
| { | ||
| StringBuf buf; | ||
| str_insert_int(buf, 0, val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work for values >= 2^31
src/libaudcore/playlist-utils.cc
Outdated
| return str_compare_encoded(get_basename(a), get_basename(b)); | ||
| } | ||
|
|
||
| static int tuple_compare_datetime(const Tuple & a, const Tuple & b, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just make tuple_compare_int take int64 and avoid duplication
src/libaudcore/probe.cc
Outdated
| // cleanly replace existing tuple | ||
| new_tuple.set_state(Tuple::Valid); | ||
|
|
||
| int64_t mtime = 0, ctime = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to avoid using "ctime" naming to avoid confusion
src/libaudcore/vfs_local.cc
Outdated
| if (mtime) | ||
| *mtime = st.st_mtime; | ||
| if (ctime) | ||
| *ctime = st.st_ctime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't creation time. For systems where we don't know how to get creation time, we should just return e.g. -1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when i google "ctime on windows" it keeps popping up that it actually is creation time??
yeah... idk... Microsoft... -_-
duping functions for int64 from int, we could replace them to accept int64, but not sure if that breaks anything
03925d0 to
9251b56
Compare
|
I have no idea why but Song Info isn't updating at all for me when I change anything and recompile, That is only thing that is missing qt/gtk fields for date times, other than that I think everything is working properly? Edit: |
tuple_compare_date calls get_int64, we need to allow Int types to get/set Int64
(closes #1701)
works:
arch linux 6.17.9-arch1-1